Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: How to pass a file to GetOpt

by Anonymous Monk
on Jul 10, 2012 at 22:01 UTC ( [id://980960]=note: print w/replies, xml ) Need Help??


in reply to Re: How to pass a file to GetOpt
in thread How to pass a file to GetOpt

Sorry, forgot to clarify, I am using Windows command prompt. I am looking for how to do this in the code. For example:

while ($input){

Only that doesn't work.

Replies are listed 'Best First'.
Re^3: How to pass a file to GetOpt
by onelesd (Pilgrim) on Jul 10, 2012 at 22:09 UTC

    # usage: # script.pl /path/to/infile /path/to/outfile die "infile not defined\n" if (! defined $ARGV[0]) ; die "outfile not defined\n" if (! defined $ARGV[1]) ; open my $infile, "< $ARGV[0]" or die "can't read $ARGV[0]\n" ; open my $outfile, "> $ARGV[1]" or die "can't write $ARGV[1]\n" ; while (<$infile>) { chomp ; print $outfile "=>$_<\n" ; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 02:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found