Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: redirect Fi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 10872 of 12261
Post > Topic >>

Re: redirect Find::File to /dev/null

by krahnj@[EMAIL PROTECTED] (John W. Krahn) Apr 5, 2008 at 07:20 AM

protoplasm wrote:
> I'm using Find::File in my program. Unfortunately I get the ugly
> 'Permission denied' output that I'd normally redirect to /dev/null if
> I was using bash.
>=20
> Here is the command I used to generate the Find::File code:
> $ find2perl /usr -name libaest.dylib -print
>=20
> I saved that to a new file and tested:
>=20
> @[EMAIL PROTECTED]
 ~/development/perl] ./find_test.pl
> /usr/local/lib/libaest.dylib
> Can't cd to (/usr/share/wikid/help/de.lproj/) wiki: Permission denied
>  at ./find_test.pl line 22
> Can't cd to (/usr/share/wikid/help/en.lproj/) wiki: Permission denied
>  at ./find_test.pl line 22
> Can't cd to (/usr/share/wikid/help/fr.lproj/) wiki: Permission denied
>  at ./find_test.pl line 22
> Can't cd to (/usr/share/wikid/help/ja.lproj/) wiki: Permission denied
>  at ./find_test.pl line 22
>=20
> I'd like to have the equivalent of this where I only get the actual
> result[s]:
>=20
> @[EMAIL PROTECTED]
 ~/development/perl] find /usr -name libaest.dylib -print 2> /
> dev/null
> /usr/local/lib/libaest.dylib
>=20
> Is that possible with Find::File. I'd really prefer the user not see
> the 'Permission denied' output.

perldoc File::Find

[ SNIP ]

WARNINGS
        If you run your program with the "-w" switch, or if you use the
        "warnings" pragma, File::Find will re****t warnings for several
        weird situations. You can disable these warnings by putting the
        statement

            no warnings =92File::Find=92;

        in the appropriate scope. See perllexwarn for more info about
        lexical warnings.



John
--=20
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall
 




 6 Posts in Topic:
redirect Find::File to /dev/null
sprotsman@[EMAIL PROTECTE  2008-04-04 10:41:04 
Re: redirect Find::File to /dev/null
krahnj@[EMAIL PROTECTED]   2008-04-05 07:20:31 
Re: redirect Find::File to /dev/null
sprotsman@[EMAIL PROTECTE  2008-04-05 22:11:07 
Re: redirect Find::File to /dev/null
krahnj@[EMAIL PROTECTED]   2008-04-06 12:07:43 
Re: redirect Find::File to /dev/null
sprotsman@[EMAIL PROTECTE  2008-04-07 13:16:55 
Re: redirect Find::File to /dev/null
krahnj@[EMAIL PROTECTED]   2008-04-07 16:57:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 17:53:40 CST 2008.