RE: PerlScript - FileSystemObject - Windows Scrpting Host [SEC=UNCLASSIFIED]

2008-04-03 Thread Ken Barker
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jenda Krynicky Sent: Thursday, 3 April 2008 08:55 AM To: [EMAIL PROTECTED]; beginners@perl.org Subject: Re: PerlScript - FileSystemObject - Windows Scrpting Host From: oscar gil [EMAIL PROTECTED] Hello

Re: dinamic cgi with perl

2008-04-03 Thread ken Foskey
On Wed, 2008-04-02 at 17:19 +0200, Pau Marc Munoz Torres wrote: Hi is There some easy-understanding how to use ajax with perl tutorial somewhere? i just need to know how to do a cgi script to launch a prompt (javascript) and use the answer in my script I learnt AJAX from Mastering

Re: delete columns csv file

2008-04-03 Thread e-letter
This may work for you: #!/usr/bin/perl use warnings; use strict; use Fcntl ':seek'; @ARGV = 'somefile.csv'; $^I = '.back'; my @headers = map 1, split /,/, , -1; my @keep = ( undef ) x @headers; while ( ) { chomp; my @fields = split /,/, $_, -1; for my

Re: Perl Stops Processing

2008-04-03 Thread Jenda Krynicky
From: Rob Dixon [EMAIL PROTECTED] Jenda Krynicky wrote: From: inthepickle [EMAIL PROTECTED] Really quick question. In Perl, if I open a file in notepad system( notepad.exe $file ) ; Perl stops processes and will not continue until I close notpad. How can I open the file, and have

Re: Perl Stops Processing

2008-04-03 Thread ken Foskey
On Wed, 2008-04-02 at 10:19 -0700, inthepickle wrote: Really quick question. In Perl, if I open a file in notepad system( notepad.exe $file ) ; Perl stops processes and will not continue until I close notpad. How can I open the file, and have Perl continue running? Look up start in the

cpan or perl -MCPAN ?

2008-04-03 Thread LesleyB
Hi I'm using Linux for some perl play. Which method is considered better - using cpan as a command at the command line or using 'perl -MCPAN -e ..'' ? Does using CPAN by either method above ensure the latest version of any given module or does it give the latest module for the particular

Using PERL to retrieve MP3s

2008-04-03 Thread Jim
Hi, I am trying to write a PERL script to retrieve a couple of podcasts per week. Using use XML::RSS::TimingBot I can retrieve and print the .rss file, but how do I extract the actual mp3 URL from $response-content? Thank you for you time. Jim -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: delete columns csv file

2008-04-03 Thread John W. Krahn
e-letter wrote: This may work for you: #!/usr/bin/perl use warnings; use strict; use Fcntl ':seek'; @ARGV = 'somefile.csv'; $^I = '.back'; my @headers = map 1, split /,/, , -1; my @keep = ( undef ) x @headers; while ( ) { chomp; my @fields = split /,/, $_, -1; for my $i ( 0 ..

Re: how to extract the last digit

2008-04-03 Thread Jay Savage
On Tue, Apr 1, 2008 at 5:40 PM, Chas. Owens [EMAIL PROTECTED] wrote: 2008/4/1 Jay Savage [EMAIL PROTECTED]: snip my ($last) = $number =~ /.*(\d)/; Let Perl worry about what is and isn't a digit. snip Unfortunately, with the rise of UNICODE, \d is no longer what one expects*

Re: cpan or perl -MCPAN ?

2008-04-03 Thread yitzle
I'm just guessing here, but I'm going to suggest that both methods ultimately call the same code and are therefore equivalent. Though the cpan command takes arguments, so it might speed stuff up. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: how to extract the last digit

2008-04-03 Thread Chas. Owens
2008/4/3 Jay Savage [EMAIL PROTECTED]: snip Exactly. The functionality is there to be taken advantage of. I don't see why that is unfortunate at all. How is Mongolian digit three less of a digit than arabic numeral three? That \d is unicode-aware is, IMO, it's strongest selling point over

Re: cpan or perl -MCPAN ?

2008-04-03 Thread Chas. Owens
On Thu, Apr 3, 2008 at 7:35 AM, LesleyB [EMAIL PROTECTED] wrote: snip Which method is considered better - using cpan as a command at the command line or using 'perl -MCPAN -e ..'' ? snip The cpan script was added in Perl 5.8.1. It is a command line interface to the CPAN module, so it is not

Re: how to extract the last digit

2008-04-03 Thread Jenda Krynicky
From: Chas. Owens [EMAIL PROTECTED] 2008/4/3 Jay Savage [EMAIL PROTECTED]: snip Exactly. The functionality is there to be taken advantage of. I don't see why that is unfortunate at all. How is Mongolian digit three less of a digit than arabic numeral three? That \d is unicode-aware

Re: dinamic cgi with perl

2008-04-03 Thread Dr.Ruud
ken Foskey schreef: There is also a module cgi::ajax in CPAN that you might want to look at. I guess you mean CGI::Ajax. -- Affijn, Ruud Gewoon is een tijger. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Help Appending: Does data Exists ??

2008-04-03 Thread Gerald Wheeler
Need some assistance: A script that writes (will usually appends) 8 records (rows/lines/whatever) to a flat file problem: If there are NO records with the date (date format: 03-Apr-08) of the incoming data I want to write/append these records to the file If there are existing

Re: Using PERL to retrieve MP3s

2008-04-03 Thread Mark Wagner
On 4/3/08, Jim [EMAIL PROTECTED] wrote: Hi, I am trying to write a PERL script to retrieve a couple of podcasts per week. Using use XML::RSS::TimingBot I can retrieve and print the .rss file, but how do I extract the actual mp3 URL from $response-content? Using a suitable regular

Re: Using PERL to retrieve MP3s

2008-04-03 Thread Chas. Owens
On Thu, Apr 3, 2008 at 5:10 PM, Mark Wagner [EMAIL PROTECTED] wrote: On 4/3/08, Jim [EMAIL PROTECTED] wrote: Hi, I am trying to write a PERL script to retrieve a couple of podcasts per week. Using use XML::RSS::TimingBot I can retrieve and print the .rss file, but how do

Re: Help Appending: Does data Exists ??

2008-04-03 Thread Rob Dixon
Gerald Wheeler wrote: Need some assistance: A script that writes (will usually appends) 8 records (rows/lines/whatever) to a flat file problem: If there are NO records with the date (date format: 03-Apr-08) of the incoming data I want to write/append these records to the file If

Re: delete columns csv file

2008-04-03 Thread Rob Dixon
e-letter wrote: Readers, I have a csv file (greater than 256 columns hence unable to open in spreadsheet) of the following format: column header1, column header2, column header3 1,0.0e0,0.0e0,5e-6 2,0.0e0,0.0e0,6e-7 3,0.0e0,0.0e0,0.0e0 I want to perform: if column headerx contains

question on s///;

2008-04-03 Thread itshardtogetone
Hi, With regards to the script below, inside the foreach loop, can someone explain to me why the expression $_=~ s/\nfred\n/nancy/; did not change the default variable $_ from fred (enclosed by \n) to nancy. Thanks # start of script ### use strict; open (MYDATA,

Re: Using PERL to retrieve MP3s

2008-04-03 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On 4/3/08, Jim [EMAIL PROTECTED] wrote: how do I extract the actual mp3 URL from $response-content? snip my ($url) = $response-content =~ /http:\S+?\.mp3/; and a regex is not necessarily the best way to parse HTML (consider using HTML::Parser* or one if the other

Re: question on s///;

2008-04-03 Thread Rob Dixon
[EMAIL PROTECTED] wrote: Hi, With regards to the script below, inside the foreach loop, can someone explain to me why the expression $_=~ s/\nfred\n/nancy/; did not change the default variable $_ from fred (enclosed by \n) to nancy. Thanks # start of script ###

Re: question on s///;

2008-04-03 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: With regards to the script below, inside the foreach loop, can someone explain to me why the expression $_=~ s/\nfred\n/nancy/; did not change the default variable $_ from fred (enclosed by \n) to nancy. Because there is no $_ variable with two newlines. @newdata

Re: Help Appending: Does data Exists ??

2008-04-03 Thread Gerald Wheeler
Rob Dixon [EMAIL PROTECTED] 4/3/2008 3:49 PM Gerald Wheeler wrote: Need some assistance: A script that writes (will usually appends) 8 records (rows/lines/whatever) to a flat file problem: If there are NO records with the date (date format: 03-Apr-08) of the incoming data I want to

foreach vs for

2008-04-03 Thread Ryan
I know they are both the same, I just want to know why we have both. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: foreach vs for

2008-04-03 Thread Chas. Owens
On Thu, Apr 3, 2008 at 7:29 PM, Ryan [EMAIL PROTECTED] wrote: I know they are both the same, I just want to know why we have both. snip Because originally they meant different things. The for loop was a c-style loop and the foreach loop was an iterator. Eventually it was realized that the

Re: foreach vs for

2008-04-03 Thread Rob Dixon
Chas. Owens wrote: On Thu, Apr 3, 2008 at 7:29 PM, Ryan [EMAIL PROTECTED] wrote: I know they are both the same, I just want to know why we have both. snip Because originally they meant different things. The for loop was a c-style loop and the foreach loop was an iterator. Eventually it

Re: foreach vs for

2008-04-03 Thread Chas. Owens
On Thu, Apr 3, 2008 at 8:19 PM, Rob Dixon [EMAIL PROTECTED] wrote: Chas. Owens wrote: On Thu, Apr 3, 2008 at 7:29 PM, Ryan [EMAIL PROTECTED] wrote: I know they are both the same, I just want to know why we have both. snip Because originally they meant different things. The for

Re: Help Appending: Does data Exists ??

2008-04-03 Thread Rob Dixon
Gerald Wheeler wrote: Rob Dixon [EMAIL PROTECTED] 4/3/2008 3:49 PM Gerald Wheeler wrote: Need some assistance: A script that writes (will usually appends) 8 records (rows/lines/whatever) to a flat file problem: If there are NO records with the date (date format: 03-Apr-08) of the

Re: foreach vs for

2008-04-03 Thread Rob Dixon
Chas. Owens wrote: On Thu, Apr 3, 2008 at 8:19 PM, Rob Dixon [EMAIL PROTECTED] wrote: Chas. Owens wrote: On Thu, Apr 3, 2008 at 7:29 PM, Ryan [EMAIL PROTECTED] wrote: I know they are both the same, I just want to know why we have both. snip Because originally they meant different

edit pdf

2008-04-03 Thread Wolf Blaum
hi there, I have a pile of pdf documents which may or may not contain email adresses. Now I do have to mask the [EMAIL PROTECTED] adresses into something like xyAT whereever.dot I looked at CAM::PDF and PDF::API2 - my CAM::PDF code would look like foreach my $file (@todo){ my

Re: foreach vs for

2008-04-03 Thread Chas. Owens
On Thu, Apr 3, 2008 at 8:37 PM, Rob Dixon [EMAIL PROTECTED] wrote: snip * Note, this is not real Huffman encoding, just Larry Wall's version of it. Huffman encoding is a compression algorithm, used in GIF files if I remember correctly. It's not relevant to human-readable text. If you're

Re: foreach vs for

2008-04-03 Thread yitzle
Huffman encoding is basically the idea that the more often a symbol is used, the shorter it should be. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Problem with Music::Tag modules

2008-04-03 Thread stevem
I'm only starting to use CPAN modules and already over my head. I installed Bundle::Music::Tag and it seemed to go OK. But when I try a variation on the module's example program: #!/usr/bin/perl use Music::Tag; my $filename = tune.mp3; my $info = Music::Tag-new($filename,