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

Re: Parse for a name after a keyword search in all the files, given directory as input

by kcott (Archbishop)
on Feb 18, 2017 at 00:11 UTC ( [id://1182250]=note: print w/replies, xml ) Need Help??


in reply to Parse for a name after a keyword search in all the files, given directory as input

G'day prash_sri,

Welcome to the Monastery.

I see you've received copious, excellent advice on things to fix.

When you've fixed all those issues, and finally want to open a specific file, remember that the file is in $dir, which is not necessarily the current directory: open "$dir/$file", not $file.

When dealing with a single item, use the singular form, as I did in the previous paragraph: use $file not $files (which looks like an arrayref to me, e.g. my $files = \@files;).

Also, you might find the autodie pragma useful.

— Ken

  • Comment on Re: Parse for a name after a keyword search in all the files, given directory as input
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found