Re: Closing File Handles

2010-05-11 Thread Whacky™
On Apr 30, 9:30 pm, jcas...@activenetwerx.com ("Joseph L. Casale") wrote: > Is it required to manually close a file handle I used > to write debugging info to when the Perl scripts exits? > > Seems like a waste of effort at the end of the script to > test `if debug...` and close the fh after? > > T

Re: Closing File Handles

2010-04-30 Thread Shawn H Corey
Harry Putnam wrote: "Joseph L. Casale" writes: Is it required to manually close a file handle I used to write debugging info to when the Perl scripts exits? Seems like a waste of effort at the end of the script to test `if debug...` and close the fh after? Not required no... that is, it won

Re: Closing File Handles

2010-04-30 Thread Harry Putnam
"Joseph L. Casale" writes: > Is it required to manually close a file handle I used > to write debugging info to when the Perl scripts exits? > > Seems like a waste of effort at the end of the script to > test `if debug...` and close the fh after? Not required no... that is, it won't cause an err

Closing File Handles

2010-04-30 Thread Joseph L. Casale
Is it required to manually close a file handle I used to write debugging info to when the Perl scripts exits? Seems like a waste of effort at the end of the script to test `if debug...` and close the fh after? Thanks! jlc -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: removing a 'tee'd file handles going forward

2009-08-26 Thread Tony Esposito
Thank you all for the input ... I have it working now. :-) From: Tim Bowden To: Perl Beginners Sent: Wednesday, 26 August, 2009 15:20:13 Subject: Re: removing a 'tee'd file handles going forward On Wed, 2009-08-26 at 18:22 +, Tony Espo

Re: removing a 'tee'd file handles going forward

2009-08-26 Thread Tim Bowden
> > I want to switch back-and-forth between being able to print to STDOUT, STDERR > with one 'print' statement and then back ... > > HTH > > > > > > > From: Jenda Krynicky > To: Beginners Perl > Sent: We

Re: removing a 'tee'd file handles going forward

2009-08-26 Thread Tony Esposito
009 13:51:03 Subject: Re: removing a 'tee'd file handles going forward From: Tony Esposito > Agreed.  But the program flow would be such (pseudo-code): > > (1) print STDOUT >     print STDERR > (2) now print to both in one print statement > > (3) now go back to >   

Re: removing a 'tee'd file handles going forward

2009-08-26 Thread Jenda Krynicky
From: Tony Esposito > Agreed.  But the program flow would be such (pseudo-code): > > (1) print STDOUT >     print STDERR > (2) now print to both in one print statement > > (3) now go back to >     print STDOUT >     print STDERR > > I want to switch back-and-forth between being able to print to ST

Re: removing a 'tee'd file handles going forward

2009-08-26 Thread Tony Esposito
print' statement and then back ... HTH From: Jenda Krynicky To: Beginners Perl Sent: Wednesday, 26 August, 2009 10:44:15 Subject: Re: removing a 'tee'd file handles going forward Date sent:    Wed, 26 Aug 2009 15:36:26 + (GMT) From:    To

Re: removing a 'tee'd file handles going forward

2009-08-26 Thread Jenda Krynicky
Date sent: Wed, 26 Aug 2009 15:36:26 + (GMT) From: Tony Esposito Subject:removing a 'tee'd file handles going forward To: Beginners Perl > I want to output to both STDOUT and STDERR at one point in my program, then > want to separate the two handles goin

removing a 'tee'd file handles going forward

2009-08-26 Thread Tony Esposito
I want to output to both STDOUT and STDERR at one point in my program, then want to separate the two handles going forward in the program so that output is sent to STDOUT and STDERR separately.  Given the code snip below, would the "undef tee" do the trick?   use IO::Tee; my $tee = new IO::Tee(

Re: Hash variable is not imported?? (Re: Storing File Handles for writing)

2007-01-16 Thread Michael Alipio
Hi John! - Original Message > From: John W. Krahn <[EMAIL PROTECTED]> > To: Perl Beginners > Sent: Tuesday, January 16, 2007 8:15:36 AM > Subject: Re: Hash variable is not imported?? (Re: Storing File Handles for > writing) > > > > open( LOGFILE, &

Re: Hash variable is not imported?? (Re: Storing File Handles for writing)

2007-01-16 Thread Tom Phoenix
On 1/16/07, Michael Alipio <[EMAIL PROTECTED]> wrote: Variable "$clientdevice" is not imported at extractdevice.pl line 23. Since you were good enough to "use strict" (thank you!) Perl is pointing out that you never declared any $clientdevice variable before using it: open FH, '>>', $cl

Re: Hash variable is not imported?? (Re: Storing File Handles for writing)

2007-01-16 Thread John W. Krahn
Michael Alipio wrote: > Hi Mumia, It's John but hello anyway. > I think this one is closer to my goal. > > #!/usr/local/bin/perl > use warnings; > use strict; > > my $logfile='fortilog'; > my $devicefile='deviceid'; > our %clientdevice; > > open DEVICES, '<', $devicefile or die "Can't open $de

Hash variable is not imported?? (Re: Storing File Handles for writing)

2007-01-16 Thread Michael Alipio
Hi Mumia, I think this one is closer to my goal. #!/usr/local/bin/perl use warnings; use strict; my $logfile='fortilog'; my $devicefile='deviceid'; our %clientdevice; open DEVICES, '<', $devicefile or die "Can't open $devicefile $!"; while (){ (my $client) = $_ =~ /^(\S+\s+)/; (my $device)

Re: Why are file handles wierd?

2004-10-18 Thread John W. Krahn
Shaw, Matthew wrote: No one has mentioned (I think) that filehandles are actually 'typeglobs' Scalars, arrays, hashes, subroutines, filehandles and directory handles are all part of a typeglob. $ perl -le' $x = 987; @x = qw/a b c d/; sub x { print qq/z is "@z" "@_"/ } *z = *x; z( $z ) if $z == 98

RE: Why are file handles wierd?

2004-10-18 Thread Shaw, Matthew
No one has mentioned (I think) that filehandles are actually 'typeglobs' yet so I thought I'd chime in on this. They also actually do have an associated sigil: '*'. There's plenty of explanation on filehandles in typeglobs in the following documents: perldoc perldata (Heading: 'Typeglobs and File

Re: Why are file handles wierd?

2004-10-18 Thread John W. Krahn
Chris Devers wrote: On Sat, 16 Oct 2004, Brian Gunlogson wrote: A filehandle is kinda like a namespace for the file. It shouldn't have a datatype, because it doesn't contain data. Files don't contain data?? He said *filehandles* don't contain data, not files. :-) Which is not strictly true or the

Re: Why are file handles wierd?

2004-10-17 Thread Chris Devers
On Sat, 16 Oct 2004, Brian Gunlogson wrote: > A filehandle is kinda like a namespace for the file. It shouldn't have > a datatype, because it doesn't contain data. Files don't contain data?? I can see the point you're trying to convey, but this probably wasn't the most accurate way to express

Re: Why are file handles wierd?

2004-10-16 Thread Brian Gunlogson
imple: > > What is the logic that says all data types will be prefixed with special > character such as "$" or "%" or "@" except file handles? Why are file > handles weird? ___ Do you Yahoo!? Declare Yours

Re: Why are file handles wierd?

2004-10-16 Thread John W. Krahn
Siegfried Heintze wrote: I asked this question previously, but received no response. I sure the reason was that I was far too verbose. So let me make it simple: What is the logic that says all data types will be prefixed with special character such as "$" or "%" or "@"

Re: Why are file handles wierd?

2004-10-16 Thread Gunnar Hjalmarsson
Siegfried Heintze wrote: What is the logic that says all data types will be prefixed with special character such as "$" or "%" or "@" except file handles? It's the syntax of the programming language we are discussing here, rather than "logic". That

RE: Why are file handles wierd?

2004-10-16 Thread Siegfried Heintze
are file handles wierd? > > What is the logic that says all data types will be prefixed with special > character such as "$" or "%" or "@" except file handles? Why are file > handles weird? > > If you like, you can make it look like :

Re: Why are file handles wierd?

2004-10-16 Thread Bee
> > What is the logic that says all data types will be prefixed with special > character such as "$" or "%" or "@" except file handles? Why are file > handles weird? > > If you like, you can make it look like : open my $FH, "<",

Why are file handles wierd?

2004-10-16 Thread Siegfried Heintze
I asked this question previously, but received no response. I sure the reason was that I was far too verbose. So let me make it simple: What is the logic that says all data types will be prefixed with special character such as "$" or "%" or "@" except file handl

Wanted: Help understanding files, file handles and typeglobs

2004-10-10 Thread Siegfried Heintze
and not "my" here? Just what exactly is FH now? Is it an array that contains six empty values, one for each: $FH, @FH, %FH and &FH? . continuing open(FH, $path) or return undef; So FH is a file handle. Are file handles the only type of value is that is not preceded by a

Re: Passing file handles into modules

2004-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Unfourtunately, the code is on an isolated PC. Post again from the machine your script is on, or use some transfer machine to move it to the machine you post from. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Passing file handles into modules

2004-04-04 Thread Randy W. Sims
On 4/4/2004 11:34 AM, [EMAIL PROTECTED] wrote: Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Here is

Re: Passing file handles into modules

2004-04-04 Thread Lolbassett
Unfourtunately, the code is on an isolated PC. I am using a scalar to store the file handle, it was opened in the main script and then passed to the module which is used to read 16bits from the file and split it into an array containing each element (my module is using 16bit machine code instru

Re: Passing file handles into modules

2004-04-04 Thread WC -Sx- Jones
[EMAIL PROTECTED] wrote: Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? I think you passed a FH out of

Re: Passing file handles into modules

2004-04-04 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Thanks, Lewis AS Bassett S

Passing file handles into modules

2004-04-04 Thread Lolbassett
Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Thanks, Lewis AS Bassett -- To unsubscribe, e-mail:

Passing file handles into modules

2004-04-04 Thread Lolbassett
Hey! I'm having some trouble passing a file handle from a script into a module as a function parameter. I'm passing it as a variable. The program says that I'm trying to use an un-opened file handle. Does anybody have any thoughts on this? Thanks, Lewis AS Bassett -- To unsubscribe, e-mail:

Re: Is this possible? (file handles)

2004-04-02 Thread R. Joseph Newton
Jeff Westman wrote: > This doesn't answer my question. Okay > I wanted to know if it is > possible to remove a file using the FH name, not the variable name > referencing it. No. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Is this possible? (file handles)

2004-04-01 Thread WC -Sx- Jones
Jeff Westman wrote: Venugopal P <[EMAIL PROTECTED]> wrote: Once you close the file, memory for the file handle will be deallocated. You can unlink file using the original file name. unlink ("abc"); This doesn't answer my question. I wanted to know if it is possible to remove a file using the F

RE: Is this possible? (file handles)

2004-04-01 Thread Jeff Westman
ove a file using the FH name, not the variable name referencing it. Please see my original post below. Thanks again, JW > -Original Message- > From: Jeff Westman [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 01, 2004 2:02 AM > To: perl_help > Subject: Is this pos

Re: Is this possible? (file handles)

2004-04-01 Thread Smoot Carl-Mitchell
On Fri, 2 Apr 2004 10:55:07 +0530 "Venugopal P" <[EMAIL PROTECTED]> wrote: > Once you close the file, memory for the file handle will be > deallocated. You can unlink file using the original file name. > unlink ("abc"); On Unix systems, you may unlink a file after opening it. The directory entry

RE: Is this possible? (file handles)

2004-04-01 Thread Venugopal P
Once you close the file, memory for the file handle will be deallocated. You can unlink file using the original file name. unlink ("abc"); -Original Message- From: Jeff Westman [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 2:02 AM To: perl_help Subject: Is this possi

Re: Is this possible? (file handles)

2004-03-31 Thread John W. Krahn
Jeff Westman wrote: > > Hi, Hello, > I want to remove an empty file using the file handle and not a > variable name or literal name referencing it. Something like this: > > 1 #!/bin/perl > 2 use warnings; > 3 use strict; > 4 no strict 'subs'; > 5 > 6 open(F,

Is this possible? (file handles)

2004-03-31 Thread Jeff Westman
Hi, I want to remove an empty file using the file handle and not a variable name or literal name referencing it. Something like this: 1 #!/bin/perl 2 use warnings; 3 use strict; 4 no strict 'subs'; 5 6 open(F, "> abc") or die "cant create file: $!"; 7 cl

Re: [HOW TO] File Handles and Tokens

2004-03-08 Thread Paul Johnson
WC -Sx- Jones said: > QUESTION - Can anyone tell me the trick to get __DATA__ to read the > preceeding program code? seek DATA, 0, 0; -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

[HOW TO] File Handles and Tokens

2004-03-07 Thread WC -Sx- Jones
Part Two of an Infinite Series... STANDARD FILE HANDLES * By convention, all filehandles and dirhandles are capitalized. HANDLE PURPOSE STDIN Standard Input STDOUT Standard Output STDERR Standard Error ARGVArgument passed on the script's command line DATAData at end of s

Re: logrotate and perl file handles. How do I know when to reopen my log file? (fwd)

2004-01-30 Thread John McKown
Sorry if this is a repost, but I haven't seen it come across the list and I did have some problems with my mail server when I originally tried to post it. What is happening is that once a file has been opened, the handle points to the "inode" which is an internal "number". This "number" is uni

Re: logrotate and perl file handles. How do I know when to reopen my log file?

2004-01-29 Thread TeamSolCO
CTED]> Sent: Thursday, January 29, 2004 5:43 PM Subject: Re: logrotate and perl file handles. How do I know when to reopen my log file? : What is happening is that once a file has been opened, the handle points : to the "inode" which is an internal "number". This "numb

Re: logrotate and perl file handles. How do I know when to reopen my log file?

2004-01-29 Thread John McKown
What is happening is that once a file has been opened, the handle points to the "inode" which is an internal "number". This "number" is unique for a filesystem and identifies the file regardless of its "name" in the directory. That is why your Perl program is "following" the "old name". Anyway,

Re: logrotate and perl file handles. How do I know when to reopen my log file?

2004-01-29 Thread TeamSolCO
om: "Robby Russell" <[EMAIL PROTECTED]> To: "TeamSolCO" <[EMAIL PROTECTED]> Sent: Thursday, January 29, 2004 4:54 PM Subject: Re: logrotate and perl file handles. How do I know when to reopen my log file? : TeamSolCO typed this on 01/29/2004 01:16 PM: : > I ha

logrotate and perl file handles. How do I know when to reopen my log file?

2004-01-29 Thread TeamSolCO
I have written a long running perl application to help me with some trivial administrative functions. Due to the volume of logging generated by this application, I am managing its output with logrotate. The problem I face is that perl is "following" the log files that logrotate swaps out.

Re: Holding File handles in a {} anonymous hash

2003-10-09 Thread Rob Dixon
Rob Dixon wrote: > > Dan Anderson wrote: > > > > I have a module that works with a couple of different file handles. Is > > it possible to hide them within an anonymous hash? {} (i.e. the objects > > data). Right now I have: > > > >

Re: Holding File handles in a {} anonymous hash

2003-10-07 Thread Rob Dixon
Wiggins D'Anconia wrote: > > Dan Anderson wrote: > > > I have a module that works with a couple of different file handles. Is > > it possible to hide them within an anonymous hash? {} (i.e. the objects > > data). Right now I have: > > > >

RE: Holding File handles in a {} anonymous hash

2003-10-07 Thread Roberts Mr Richard L
Tuesday, October 07, 2003 3:44 PM To: [EMAIL PROTECTED] Subject: Re: Holding File handles in a {} anonymous hash Dan Anderson wrote: > I have a module that works with a couple of different file handles. Is > it possible to hide them within an anonymous hash? {} (i.e. the objects > data).

Re: Holding File handles in a {} anonymous hash

2003-10-07 Thread Rob Dixon
Dan Anderson wrote: > I have a module that works with a couple of different file handles. Is > it possible to hide them within an anonymous hash? {} (i.e. the objects > data). Right now I have: > > if (condition_is_met()) { > open("FILE"," } > > This

RE: Holding File handles in a {} anonymous hash

2003-10-07 Thread Wiggins d'Anconia
On Tue, 07 Oct 2003 15:22:34 -0400, Dan Anderson <[EMAIL PROTECTED]> wrote: > I have a module that works with a couple of different file handles. Is > it possible to hide them within an anonymous hash? {} (i.e. the objects > data

Holding File handles in a {} anonymous hash

2003-10-07 Thread Dan Anderson
I have a module that works with a couple of different file handles. Is it possible to hide them within an anonymous hash? {} (i.e. the objects data). Right now I have: if (condition_is_met()) { open("FILE","

Re: Passing file handles to sub-routines ...

2003-07-10 Thread John W. Krahn
rint() on closed > > filehandle $fh at ./test.pl line [n]". > > > > This is just my first step to being able to pass file handles to my > > sub-routines. What have I missed? > > > > open my $fh, "test" || die $!; > > print $fh "Hello

Re: Passing file handles to sub-routines ...

2003-07-10 Thread deb
Please see correction, below: At 13:14:50, on 07.10.03: Cracks in my tinfoil beanie allowed deb to seep these bits into my brain:, > Try this (untested): > #The variable $fh is not a filehandlie - you need to assign that: > > my $fh = "somefile"; > This line isn't quite right: > open (FILE, ">$f

Re: Passing file handles to sub-routines ...

2003-07-10 Thread deb
When I run it, I get an error "print() on closed > filehandle $fh at ./test.pl line [n]". > > This is just my first step to being able to pass file handles to my > sub-routines. What have I missed? > > open my $fh, "test" || die $!; > print $fh "

RE: Passing file handles to sub-routines ...

2003-07-10 Thread Bob Showalter
Jamie Risk wrote: > I'm a casual PERL programmer at best, and I have a working facsimile > of the non-working code below. When I run it, I get an error > "print() on closed filehandle $fh at ./test.pl line [n]". > > This is just my first step to being able to

Re: Passing file handles to sub-routines ...

2003-07-10 Thread Rob Dixon
gt; This is just my first step to being able to pass file handles to my > sub-routines. What have I missed? > > open my $fh, "test" || die $!; > print $fh "Hello!\n"; > close $fh; You've opened the file 'test' for reading. Substitute open my $fh

Passing file handles to sub-routines ...

2003-07-10 Thread Jamie Risk
I'm a casual PERL programmer at best, and I have a working facsimile of the non-working code below. When I run it, I get an error "print() on closed filehandle $fh at ./test.pl line [n]". This is just my first step to being able to pass file handles to my sub-routines. What have

Re: File Handles in subroutines

2003-06-25 Thread John W. Krahn
erl5.6, you had to deal with various type­ >glob idioms which you may see in older code. > >open FILE, "> $filename"; >process_typeglob( *FILE ); >process_reference( \*FILE ); >

Re: File Handles in subroutines

2003-06-25 Thread Kevin Pfeiffer
llo World!\n"; process_file( $fh ); Before perl5.6, you had to deal with various type­ glob idioms which you may see in older code. open FILE, "> $filename"; process_typeglob( *FILE );

Re: File Handles in subroutines

2003-06-25 Thread John W. Krahn
Joshua Scott wrote: > > What do I need to do in order to use a filehandle that was opened earlier in > a program within a subroutine? perldoc -q filehandle Found in /usr/lib/perl5/5.6.0/pod/perlfaq5.pod How do I flush/unbuffer an output filehandle? Why must I do this? How

RE: File Handles in subroutines

2003-06-25 Thread Kipp, James
> > > What do I need to do in order to use a filehandle that was > opened earlier in > a program within a subroutine? I've included an example of > the code I have > that is not doing what I would like. Basically, I never get > any output to > the file. If I change it so that it doesn't use

Re: File Handles in subroutines

2003-06-25 Thread Sudarshan Raghavan
Scott, Joshua wrote: What do I need to do in order to use a filehandle that was opened earlier in a program within a subroutine? I've included an example of the code I have that is not doing what I would like. Basically, I never get any output to the file. If I change it so that it doesn't use

RE: File Handles in subroutines

2003-06-25 Thread Gupta, Sharad
Did open ever succeeded?? Check with: open(FILE,">>$logfile") or die "$!"; -sharad -Original Message- From: Scott, Joshua [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 11:13 PM To: [EMAIL PROTECTED] Subject: File Handles in subroutines Wha

File Handles in subroutines

2003-06-24 Thread Scott, Joshua
What do I need to do in order to use a filehandle that was opened earlier in a program within a subroutine? I've included an example of the code I have that is not doing what I would like. Basically, I never get any output to the file. If I change it so that it doesn't use the subroutine when wr

Re: do statements, blocks, and temporary file handles (was: How to avoid this Warning ?)

2003-02-18 Thread Paul
> > my $fh = do { local *_ }; > > That doesn't do anything useful either. My guess is that Perl will > attempt to stringify the typeglob and put something like > qw( *package::_ ) into $x. You sure? Somebody once told me to use my $fh = do { local *FH }; because local saves the previous val

Re: do statements, blocks, and temporary file handles (was: How to avoid this Warning ?)

2003-02-18 Thread Rob Dixon
Paul wrote: > > > my $x = do { code }; > > > works, because do flips the context, expecting a block and > > > returning a value. > > > > I hadn't actually thought of it that way, but it's remarkably well > > explained. Well done. > > Thanks! > > > > That way I can say > > > my $fh = do { local

Re: do statements, blocks, and temporary file handles (was: How to avoid this Warning ?)

2003-02-18 Thread Paul
> > my $x = do { code }; > > works, because do flips the context, expecting a block and > > returning a value. > > I hadn't actually thought of it that way, but it's remarkably well > explained. Well done. Thanks! > > That way I can say > > my $fh = do { local $_ }; > > open $fh, $file or

do statements, blocks, and temporary file handles (was: How to avoid this Warning ?)

2003-02-18 Thread Rob Dixon
Paul wrote: > --- Rob Dixon <[EMAIL PROTECTED]> wrote: > > Paul wrote: > > > > do { > > > > my $empty; > > > > $empty ++; > > > > }; > > > > > > Also, the do() is superfluous here, isn't it? > > > > I was trying to show something that would return a value in > > the same way

Re: file handles!

2002-10-09 Thread Steve Grazzini
Jean Padilla <[EMAIL PROTECTED]> wrote: > Hi, pravesh > 1 - You are saying "mv < 2 - a file handle is *not* to be confused with a file name Actually - Perl will let you do our $FH = 'path'; open FH or die...; # open FH, '<', $FH Doesn't work with 'my' variables, though. > try : > > my $f

Re: file handles!

2002-10-09 Thread Jean Padilla
Hi, pravesh 1 - You are saying "mv < > HI > I define a file the following way: > > $FILE_HANDLE = "< > then I openit > > open(FILEHANDLE); > > i perform some operations.. > > and then I want to transfer this "somefile" to some other directory > > but I am not able to use mv comand to do i

file handles!

2002-10-09 Thread Pravesh Biyani
HI I define a file the following way: $FILE_HANDLE = "<

RE: file handles in cgi

2002-04-03 Thread David Gray
> > this is the perl script : abc.pl(say) -- this is in my cgi-bin... > > > > #!/usr/bin/perl > > print "content-type: text/html\n\n"; > > You need to print html headers when you're printing to a browser, i.e. > > print "Content-type:text/html\n\n"; > > -dave I must be blind this morning...

RE: file handles in cgi

2002-04-03 Thread David Gray
> this is the perl script : abc.pl(say) -- this is in my cgi-bin... > > #!/usr/bin/perl > print "content-type: text/html\n\n"; > > open (IN, ">abc.txt"); > $x = ($inputs{name}); > print IN $x; > close (IN); > > open (IN, "abc.txt"); > @arr = ; > print @arr; > close (IN); > > and this is th

file handles in cgi

2002-04-03 Thread mnp4
hi, this is the perl script : abc.pl(say) -- this is in my cgi-bin... #!/usr/bin/perl print "content-type: text/html\n\n"; open (IN, ">abc.txt"); $x = ($inputs{name}); print IN $x; close (IN); open (IN, "abc.txt"); @arr = ; print @arr; close (IN); and this is the html ... abc.html(say) i

[Q]File Handles.

2002-02-21 Thread Bhanu Prakash
Perl Gurus, Can somebody tell me what is the difference between the two , with some examples? open("|/usr/users//"); and open("/usr/users//"); Thanks for the response Bhanu. = Bhanu Prakash G V S __ Do You Yahoo!? Yahoo! Sports - Coverage of

Re: File Handles as arguments...

2001-06-11 Thread Paul
--- Mike Breeze <[EMAIL PROTECTED]> wrote: > -- Original Message -- > From: "Evgeny Goldin (aka Genie)" <[EMAIL PROTECTED]> > > > >> CODE 3: > >> printit(*Some_Handle); > > > >> CODE 4: > >> printit(\*Some_Handle); > > > > > >If you're choosing betw

Re: File Handles as arguments...

2001-06-11 Thread Mike Breeze
-- Original Message -- From: "Evgeny Goldin (aka Genie)" <[EMAIL PROTECTED]> > >> CODE 3: >> printit(*Some_Handle); > >> CODE 4: >> printit(\*Some_Handle); > > >If you're choosing between those two - CODE 4 looks better as it passes >the reference to

Re: File Handles as arguments...

2001-06-11 Thread Evgeny Goldin (aka Genie)
> CODE 3: > printit(*Some_Handle); > CODE 4: > printit(\*Some_Handle); If you're choosing between those two - CODE 4 looks better as it passes the reference to typeglob instead of the typeglob itself and passing references is always the better way to do things. CODE 4 is a usual way fo

File Handles as arguments...

2001-06-09 Thread Mike Breeze
Hi all, Firstly, this a great list. Thanks to those responsible for coming up with it and supporting it. I'm writing some subroutines that will require a filehandle to be passed in. I've been looking at a FAQ on perl.com (http://www.perl.com/pub/doc/FAQs/FAQ/oldfaq-html/Q5.25.html), which sugges