Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: The right way to avoid an error

by DrZaius (Monk)
on May 18, 2001 at 20:38 UTC ( [id://81546]=note: print w/replies, xml ) Need Help??


in reply to The right way to avoid an error

Why not:
use strict; use IO::File; use constant INDEX_FILE => './index.html'; my $fh = IO::File->new(INDEX_FILE) or die INDEX_FILE, ":$!"; while(<$fh>) { if(m!<a href=["']([^"']+)!i) { my $mp3 = $1; system('mpg123', "-p none -b 500 -q $mp3") if($mp3 =~ m!$ARGV[0]!i); } }
Or, even better (not perl, and uses filesystem instead):
find . -type f -iname '*.mp3' | grep "pattern here" | xargs mpg123 -p +none -b 500 -q
have fun.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-24 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found