Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: read/write perl variables to/from file

by K_M_McMahon (Hermit)
on Feb 14, 2005 at 22:41 UTC ( [id://430976]=note: print w/replies, xml ) Need Help??


in reply to read/write perl variables to/from file

after your code, insert this.
print FILE $myVar; close(FILE); open (FILE,"<$filename") or die "I cannot open $filename to read.\n"; my @file_contents=<FILE>; close(FILE); print "$myVar should equal ".chomp($file_contents[0])."\n";

-Kevin
my $a='62696c6c77667269656e6440676d61696c2e636f6d'; while ($a=~m/(^.{2})/s) {print unpack('A',pack('H*',"$1"));$a=~s/^.{2}//s;}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://430976]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-03-19 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found