|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can file handlers are passed to functions as parameters ?
can file handlers are passed to functions as parameters ?
if yes pls suggest me how to write a code? |
|
#2
|
||||
|
||||
|
Have a look at perlfaq7.
__________________
~ishnid; Have you tried: [ search.cpan.org | perldoc | Java API | mysql.com | google ] Apostrophes are NOT used for possessive pronouns or for noun plurals, including acronyms. |
|
#3
|
||||
|
||||
|
The FAQ example uses a typeglob to deal with the global type filehandles people are used to seeing.
I think it's a good idea to get in the habit of using lexical filehandles. It's certainly easier to wrap your head around passing them, and they are by definition localized. Code:
open my $fh, "<", $file or die "Can't open $file: $!"; my $data = process_file($fh); |
|
#4
|
|||
|
|||
|
thanks
thank you so much..
|
|
#5
|
|||
|
|||
|
Quote:
Thank you very much |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Can file handlers are passed to functions as parameters ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|