Re: Regexp to remove spaces

2009-12-22 Thread sftriman
Thanks to everyone for their input! So I've tried out many of the methods, first making sure that each works as I intended it. Which is, I'm not concerned with multi-line text, just single line data. That said, I have noted that I should use \A and \z in general over ^ and $. I wrote a 176 byte

retrieving and parsing an excel spreadsheet

2009-12-22 Thread paul
I want to retrieve an excel spreadsheet (eventually several at different locations) and display the contents in a web page. if i copy the file locally ive got everything working as expected.I cant retrieve the file and do the same though. if i do this with a local file it works #!/usr/bin/perl

Re: XML::Simple question

2009-12-22 Thread Jenda Krynicky
From: "Mike Blezien" > Hello, > > were using the XML/Simple module to process a XML response using the code > below. > But for some reason the module can't read the $xmlresponse data unless we > create > a temp file first to store the data then pass that to the module. Is th

Re: XML::Simple question

2009-12-22 Thread Mike Blezien
- Original Message - From: "Robert Wohlfarth" To: "Perl List" Sent: Tuesday, December 22, 2009 5:47 PM Subject: Re: XML::Simple question On Tue, Dec 22, 2009 at 9:54 AM, Mike Blezien wrote: were using the XML/Simple module to process a XML response using the code below. But for s

Re: XML::Simple question

2009-12-22 Thread Robert Wohlfarth
On Tue, Dec 22, 2009 at 9:54 AM, Mike Blezien wrote: > were using the XML/Simple module to process a XML response using the code > below. But for some reason the module can't read the $xmlresponse data > unless we create a temp file first to store the data then pass that to the > module. Is there

Re: $? $! ??????????????

2009-12-22 Thread John W. Krahn
Aimee Cardenas wrote: Ok, All, Hello, I'm a little confused. How does your outputs from die and print differ when you put either $! or $? at the end of the statement? I've been using $! at the end of my die statements and am afraid that I've been unknowingly not using the correct syntax

Re: $? $! ??????????????

2009-12-22 Thread Shawn H Corey
Aimee Cardenas wrote: > Ok, All, > > I'm a little confused. How does your outputs from die and print differ > when you put either $! or $? at the end of the statement? I've been > using $! at the end of my die statements and am afraid that I've been > unknowingly not using the correct syntax be

$? $! ??????????????

2009-12-22 Thread Aimee Cardenas
Ok, All, I'm a little confused. How does your outputs from die and print differ when you put either $! or $? at the end of the statement? I've been using $! at the end of my die statements and am afraid that I've been unknowingly not using the correct syntax because my code never dies!

Re: regex question

2009-12-22 Thread John W. Krahn
Parag Kalra wrote: You can try following: $_ =~ s/^\.(\s)+//g; You are using capturing parentheses but you are not using the results of that capture anywhere so why use them? You are using capturing parentheses in LIST context so even if there are multiple whitespace characters you are onl

Re: Comparison of the comma versus the period in print statements

2009-12-22 Thread John W. Krahn
Marc Perry wrote: Hi, Hello, I noticed that most beginner texts will introduce and use print like this: print $moose, $squirrel, $boris, "\n"; However, when I review code from CPAN, I often (typically) see: print $bullwinkle . $rocky . $natasha . "\n"; As I recall, print is a list operato

Re: demystify

2009-12-22 Thread John W. Krahn
Vishnu wrote: I was going through the book intermediate perl and came across the following code. my @odd_digit_sum = grep digit_sum_is_odd($_), @input_numbers; sub digit_sum_is_odd { my $input = shift; > what are we doing here? my @digits = split //, $input; # Assu

Re: being smart about script structure

2009-12-22 Thread Bryan R Harris
> Bryan R Harris wrote: > >>> perl -wle ' >>> >>> sub inc{ ++$_ for @_ } >>> >>> my @x = 1 .. 5; >>> >>> inc @x; >>> >>> print "@x"; >>> ' >>> 2 3 4 5 6 >> >> >> FYI, the reason we wanted a reference was because the data set might end up >> being huge. > > FYI, there i

XML::Simple question

2009-12-22 Thread Mike Blezien
Hello, were using the XML/Simple module to process a XML response using the code below. But for some reason the module can't read the $xmlresponse data unless we create a temp file first to store the data then pass that to the module. Is there a way to do this without having to create a temp f

Re: regex question

2009-12-22 Thread Parag Kalra
Thanks Philip for sharing this excellent piece of information. Cheers, Parag On Tue, Dec 22, 2009 at 8:17 PM, Philip Potter wrote: > 2009/12/22 Parag Kalra : > > You can try following: > > > > $_ =~ s/^\.(\s)+//g; > > This isn't quite right. > > There are two ways in which you might use this

Re: Saturdays in a month

2009-12-22 Thread Robert Wohlfarth
On Tue, Dec 22, 2009 at 8:51 AM, Johnson, Reginald (GTS) < reggie_john...@ml.com> wrote: > Is there a module that I can use that will tell me the number of Saturdays, > or any weekday, if I give it the month and year. > > The Date::Manip module has methods for calculating recurring dates (like "e

Re: regex question

2009-12-22 Thread Shawn H Corey
Philip Potter wrote: > 2009/12/22 Parag Kalra : >> You can try following: >> >> $_ =~ s/^\.(\s)+//g; > > This isn't quite right. > > There are two ways in which you might use this substitution: either $_ > will contain a single line, or it will contain multiple lines. The > single line case might

Re: Comparison of the comma versus the period in print statements

2009-12-22 Thread Shawn H Corey
Shlomi Fish wrote: > Of course, setting it to anything but the default is a sure fire way to break > practically most production code out there , and "Perl Best Practices" > recommends against setting it. But it may be useful in one-liners / small > scripts / golfs / obfuscations / etc. If you'

Saturdays in a month

2009-12-22 Thread Johnson, Reginald (GTS)
Is there a module that I can use that will tell me the number of Saturdays, or any weekday, if I give it the month and year. Reginald Johnson TSM Backup & Restore Services <> Jacksonville, FL 904.218.4620 -- This message

Re: regex question

2009-12-22 Thread Philip Potter
2009/12/22 Parag Kalra : > You can try following: > > $_ =~ s/^\.(\s)+//g; This isn't quite right. There are two ways in which you might use this substitution: either $_ will contain a single line, or it will contain multiple lines. The single line case might look something like this: while (<>)

Re: Comparison of the comma versus the period in print statements

2009-12-22 Thread Shlomi Fish
On Tuesday 22 Dec 2009 15:01:47 Jenda Krynicky wrote: > From: Marc Perry > > > I noticed that most beginner texts will introduce and use print like > > this: > > > > print $moose, $squirrel, $boris, "\n"; > > > > However, when I review code from CPAN, I often (typically) see: > > > > print $bullw

Re: Comparison of the comma versus the period in print statements

2009-12-22 Thread Jenda Krynicky
From: Marc Perry > I noticed that most beginner texts will introduce and use print like this: > > print $moose, $squirrel, $boris, "\n"; > > However, when I review code from CPAN, I often (typically) see: > > print $bullwinkle . $rocky . $natasha . "\n"; > > As I recall, print is a list operat

Comparison of the comma versus the period in print statements

2009-12-22 Thread Marc Perry
Hi, I noticed that most beginner texts will introduce and use print like this: print $moose, $squirrel, $boris, "\n"; However, when I review code from CPAN, I often (typically) see: print $bullwinkle . $rocky . $natasha . "\n"; As I recall, print is a list operator (and therefore the comma syn

Re: regex question

2009-12-22 Thread Parag Kalra
You can try following: $_ =~ s/^\.(\s)+//g; Cheers, Parag On Tue, Dec 22, 2009 at 10:59 AM, Jim Green wrote: > Hi, > > I have a text file with lines like this > > > · Experience in C/C++ realtime system programming > > · Experience in ACE, FIX > > > Could anybody tell me whic

Re: query

2009-12-22 Thread Parag Kalra
> > > my $input = shift; > what are we doing here? > First input paramter to the subroutine is getting shifted i.e getting stored in the variable '$input' > $sum += $_ for @digits; -> what exactly is the > . > All the elements of the array '@digits' are ge

[Meta] Big examples as perl -e lines with single quotes [was Re: being smart about script structure]

2009-12-22 Thread Shlomi Fish
Hi Dr. Ruud! (and all). See below for my response. On Monday 21 Dec 2009 22:03:07 Dr.Ruud wrote: > Bryan R Harris wrote: > >> perl -wle ' > >> > >> sub inc{ ++$_ for @_ } > >> > >> my @x = 1 .. 5; > >> > >> inc @x; > >> > >> print "@x"; > >> ' > >> 2 3 4 5 6 > > > > FYI, the r

query

2009-12-22 Thread Vishnu
I was going through the book intermediate perl and came across the following code. my @odd_digit_sum = grep digit_sum_is_odd($_), @input_numbers; sub digit_sum_is_odd { my $input = shift; > what are we doing here? my @digits = split //, $input; # Assume no nondigit cha

Re: demystify

2009-12-22 Thread Erez Schatz
A pox on gmail's "reply" not sending to list. 2009/12/22 Erez Schatz : > 2009/12/21 Vishnu : >> I was going through the book intermediate perl and came across the >> following code. > > I'm not familiar with the scope of Intermediate Perl, but from your > questions it would seem that you should've

Re: being smart about script structure

2009-12-22 Thread Dr.Ruud
Bryan R Harris wrote: perl -wle ' sub inc{ ++$_ for @_ } my @x = 1 .. 5; inc @x; print "@x"; ' 2 3 4 5 6 FYI, the reason we wanted a reference was because the data set might end up being huge. FYI, there is no issue. Uh, come to think of it, I'm surprised your scr

regex question

2009-12-22 Thread Jim Green
Hi, I have a text file with lines like this · Experience in C/C++ realtime system programming · Experience in ACE, FIX Could anybody tell me which regex to use to get rid of the dot and the leading spaces before each Line? Thanks for any help! Jim -- To unsubscribe, e-ma

demystify

2009-12-22 Thread Vishnu
I was going through the book intermediate perl and came across the following code. my @odd_digit_sum = grep digit_sum_is_odd($_), @input_numbers; sub digit_sum_is_odd { my $input = shift; > what are we doing here? my @digits = split //, $input; # Assume no nondigit c