Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: user input file

by kennethk (Monsignor)
on Jun 19, 2013 at 15:37 UTC ( #1039791=note: print w/ replies, xml ) Need Help??


in reply to Re^4: user input file
in thread user input file

If you want the user to type the file name into the interactive terminal that Padre spawns, then you should assign the file name from STDIN - see I/O Operators in perlop. That code will probably look like:

my $filename = <>; chomp $filename; open(FILE,"<", $filename) or die "Open failed for $filename: $!"; + my @lines=<FILE>;
The chomp is necessary because your input will have a trailing newline which is not in the file name.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re^5: user input file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-11-26 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (172 votes), past polls