Re: Just need a yes or no answer on passing a hash to a package

2005-09-02 Thread Chris Devers
On Sat, 3 Sep 2005, Luinrandir wrote: > Yeah I was reading about references... A > i don't get it... Read upon them until you do. > I fgured I could just breah the hash into two arrays, pass them and > reconstruct the hash in the package.. of something like that... This is probably possibl

Re: Just need a yes or no answer on passing a hash to a package

2005-09-02 Thread Luinrandir
Yeah I was reading about references... A i don't get it... I fgured I could just breah the hash into two arrays, pass them and reconstruct the hash in the package.. of something like that... will read more tomorrow..maybe some sleep will make it all make sence!LOL thanks Lou - Original M

Re: Fw: Could [you] [please] tell me how to remove white spacees presentbetween delimiter[s]

2005-09-02 Thread James Taylor
#!/usr/bin/perl my $st1="'---'~^ '123PS01D'~^"; for(split(/\~\^/,$st1)) { $_ =~ s/\s//g; # Do something with your variable } Is that what you're asking? I'm unsure [EMAIL PROTECTED] wrote: '---'~^ '123PS01D'~^ here delimiter is ~^ '---'~^'123PS01D'~^ Do u see the d

Re: Just need a yes or no answer on passing a hash to a package

2005-09-02 Thread Chris Devers
On Fri, 2 Sep 2005, Luinrandir wrote: > Can I pass a hash to a package? Yes. (Hint: passing any complex data around is generally best done with the use of references, so that's the area you need to be studying up on.) Pseudocode: my $result = go_do_something_with( \%this_hash ); ... s

Just need a yes or no answer on passing a hash to a package

2005-09-02 Thread Luinrandir
First I just want to say that I have been reading books, searching the net and experimenting for about 3 hours now.. the question is, Can I pass a hash to a package? I have been readin FAQ's like there is no tomorrow.. and most of it is over my head (using double dog secret vars and code that

Re: Fw: Could [you] [please] tell me how to remove white spacees presentbetween delimiter[s]

2005-09-02 Thread Chris Devers
Please send all replies to list mail to the list, not to me. If you send it to me, I'm just going to bounce it to the list and then respond to that. Thanks. On Fri, 2 Sep 2005 [EMAIL PROTECTED] wrote: > '---'~^ '123PS01D'~^ > > here delimiter is ~^ > > '---'~^'123PS01D'~^ > > Do

Fw: Could [you] [please] tell me how to remove white spacees presentbetween delimiter[s]

2005-09-02 Thread mayank . ahuja
'---'~^ '123PS01D'~^ here delimiter is ~^ '---'~^'123PS01D'~^ Do u see the difference in the two lines In the first one there is space is present i want to remove that one The second is ok.. I think it will clear u in the better way. with regards Mayank

Re: Net::SMTP and a hash of arrays

2005-09-02 Thread Gretar M Hreggvidsson
Hi Ryan! (My MTA is playing with me, so if you are receiving this for the second time I'm deeply sorry!) Do yourself a big favor and use warnings and strict: #!/usr/bin/perl -w use strict; If you had done that you would immediately have spotted the problem, which was a missing dol

Re: Net::SMTP and a hash of arrays

2005-09-02 Thread Gretar M Hreggvidsson
Hi Ryan! Do yourself a big favor and use warnings and strict: #!/usr/bin/perl -w use strict; If you had done that you would immediately have spotted the problem, which was a missing dollar sign for the rcpts element in the line: > $email->recipient(@{ rcpts{$server} }); Shoul

why does a usenet post take so long to appear

2005-09-02 Thread Ramprasad A Padmanabhan
I posted to this group using usenet ( nntp.perl.org ). My posts dont seem to appear any reason why ? Thanks Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Numeric sort warning

2005-09-02 Thread Ramprasad A Padmanabhan
What do you get when you run perl -c Did you cut paste the program from some man page ? Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Net::SMTP and a hash of arrays

2005-09-02 Thread Ramprasad A Padmanabhan
$email->recipient(@{ rcpts{$server} }); Thats the error IMHO TRY @{$rcpts{$server}} Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: $ or % For Associative Arrays?

2005-09-02 Thread Ramprasad A Padmanabhan
Please read a book, like the perl beginners patiently. Anyway to explain in simple terms % is used for denoting the entire hash ( associative array ) $ is used for accessing a single element HTH Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <

Re: syntax Error ..........

2005-09-02 Thread Jeff 'japhy' Pinyan
On Sep 3, [EMAIL PROTECTED] said: Actually the problem is like this @lookup_datatype = qw ( string(30) string (40) string(10) Real string(10) Integer string(34) ); when my loop encounters this real or Integer or any other element in the array it gives a error problem I want to skip through th

Re: syntax Error ..........

2005-09-02 Thread mayank . ahuja
No the following error comes Use of uninitialized value in pattern match (m//) Actually the problem is like this @lookup_datatype = qw ( string(30) string (40) string(10) Real string(10) Integer string(34) ); when my loop encounters this real or Integer or any other element in t

Re: A newbe has a question relating to XML::Simple

2005-09-02 Thread Jeff 'japhy' Pinyan
On Sep 2, Bowen, Bruce said: my $data = XMLin('data.xml', forcearray=>1); for my $data (@{$data->{data}}) I'd have chosen a different name than 'data' again, but oh well. { foreach (qw(Field4)) { print $data->{$_}->[0], "\n"; } if ($data{"Field4"} eq "Column 4") Yo

Re: syntax Error ..........

2005-09-02 Thread Jeff 'japhy' Pinyan
On Sep 3, [EMAIL PROTECTED] said: foreach my $i (0 ..$#lookup_datatype){ my $plus; ($plus) = /([0-9]+)/ , $lookup_datatype[$i]; I think you want ($plus) = $lookup_datatype[$i] =~ /([0-9]+)/; -- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734

Re: syntax Error ..........

2005-09-02 Thread Manav Mathur
- Original Message - From: <[EMAIL PROTECTED]> To: Sent: Saturday, September 03, 2005 12:20 AM Subject: syntax Error .. > > Hi Guys... > > Can u plz give me the write syntax for > this > > foreach (@lookup_datatype){ > my $plus; > ($plus) = /([0-9]+)/; > > > print "$plus

syntax Error ..........

2005-09-02 Thread mayank . ahuja
Hi Guys... Can u plz give me the write syntax for this foreach (@lookup_datatype){ my $plus; ($plus) = /([0-9]+)/; print "$plus\n"; } in this form.. foreach my $i (0 ..$#lookup_datatype){ my $plus; ($plus) = /([0-9]+)/ , $lookup_datatype[$i]; print "$plus\n";

A newbe has a question relating to XML::Simple

2005-09-02 Thread Bowen, Bruce
The xml file is 1 Column 1 Column 2 Column 3 Column 4 2 Column 1 Column 2 Column 3 Column 4 And the Code so far is use strict; use warnings; use XML::Simple; my $data = XMLin('data.xml', forcearray=>1); for my $data (@{$data->{data}}) { foreach (qw(Field4)) { print $

Re: tricky list comparison problem - Resolved

2005-09-02 Thread Jason Ross
On 9/2/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Jason Ross wrote: > > > > I'm trying it on a second drive however, and am getting results that > > don't look right ... > > > The problem is that you are including the data from partition 2. If you > exclude it then you will get the correct

Re: Could u plz tell me how to remove white spacees present between delimiter

2005-09-02 Thread Jeff Pan
$_='abc, def, xyz, mno'; s/,\s+/,/g; On Fri, 2 Sep 2005 20:53:52 +0530, [EMAIL PROTECTED] said: > > Hi Perlers > > > I have a file like this in which data is > abc,def,xyz,mno, > > means the delimter is comma here > > but in the string if it comes abc, def, xyz, mno > > then plz tell m

Re: Need help... packages

2005-09-02 Thread JupiterHost.Net
Luinrandir wrote: OK.. maybe I'm trying to be too fancy. use tsruic the package is: ### package Names; @Countries("Ireland","Wales"); Don;t double quote string that have nothing being interpolated, use single quotes or q() %Lord{Ireland}=("Bob","Tom"); $Lord{Ireland}

Re: Could [you] [please] tell me how to remove white spacees present between delimiter[s]

2005-09-02 Thread Chris Devers
On Fri, 2 Sep 2005 [EMAIL PROTECTED] wrote: > I have a file like this in which data is > abc,def,xyz,mno, > > means the delimter is comma here > > but in the string if it comes abc, def, xyz, mno > > then [please] tell me how to remove this white space. The popular way to do this around her

How do you force SOAP::Lite to use document/literal SOAP messages?

2005-09-02 Thread Dave Adams
I am trying to write a simple SOAP client written in perl and to talk to a webservice written in .NET. I am unsuccessful. I believe the web service is expecting document/literal SOAP messages but I think the SOAP::Lite module sends stuff in RPC/encoded messages. Is there any way of telling? Or,

Could u plz tell me how to remove white spacees present between delimiter

2005-09-02 Thread mayank . ahuja
Hi Perlers I have a file like this in which data is abc,def,xyz,mno, means the delimter is comma here but in the string if it comes abc, def, xyz, mno then plz tell me how to remove this white space. Mayank Ahuja Assistant System Engineer Tata Consultancy Services Limited Ph:- 044-58

Re: parsing long strings

2005-09-02 Thread Jeff 'japhy' Pinyan
On Sep 2, Tom Allison said: foreach ( $string =~ /([\w\s]+):([\w\s]+)/g ) { ... } But I always get only the last pair... I thought the /g would stop that behaviour.. You're mixing 'foreach' with /.../g, and the results aren't what you'll expect. Instead, use 'while': while ($str =~ /([

Re: $ or % For Associative Arrays?

2005-09-02 Thread Scott Taylor
Mark Sargent said: > Hi All, > > am new to Perl. I'm followig this tutorial, > > http://www.cs.unc.edu/~jbs/resources/perl/perl-basics/variables.html > > and am confused as to why the below shows examples with $ and some with > % at the beginning of the statement. When it says, "Perl uses the > "p

Re: $ or % For Associative Arrays?

2005-09-02 Thread John W. Krahn
Peter Scott wrote: > > You refer to the whole hash with %. You refer to any member of it with $. > Why? The hash is a container; it has its own behavior. Each item in the > container is a scalar. Scalars begin with $ in Perl. Figure out whether > you're talking about the container or an it

Re: parsing long strings

2005-09-02 Thread Jeff Pan
$strings='toDNExtension:, toDNFailure:,'; foreach (split/,\s*/,$strings) { $hash{(split/:/,$_)[0]} = (split/:/,$_)[1]; } is this useful? On Fri, 2 Sep 2005 09:41:54 -0400 (EDT), "Tom Allison" <[EMAIL PROTECTED]> said: > > I have a really long string that looks like > 'toDNExtensi

Re: $ or % For Associative Arrays?

2005-09-02 Thread Peter Scott
On Fri, 02 Sep 2005 16:09:04 +0900, Mark Sargent wrote: > Hi All, > > am new to Perl. I'm followig this tutorial, > > http://www.cs.unc.edu/~jbs/resources/perl/perl-basics/variables.html > > and am confused as to why the below shows examples with $ and some with > % at the beginning of the sta

parsing long strings

2005-09-02 Thread Tom Allison
I have a really long string that looks like 'toDNExtension:, toDNFailure:, ' and I want to parse it into key/value pairs... I tried: foreach ( $string =~ /([\w\s]+):([\w\s]+)/g ) { ... } But I always get only the last pair... I thought the /g would stop that behaviour.. -- To unsubsc

unpacking a string

2005-09-02 Thread Octavian Rasnita
Hi, I need to unpack a string packed in next form: where: is a star character defined as ascii 2 is an end character defined as ascii 3 is a check sum calculated by performing an exclusive OR of all characters of the message, including STX but excluding ETX and then substituting ASCII 02

Re: tricky list comparison problem

2005-09-02 Thread John W. Krahn
Jason Ross wrote: > > I'm trying it on a second drive however, and am getting results that > don't look right ... > > That drive has the following partitions defined: > > * First Sector Last > * Partition Tag FlagsSector Count Sect

Re: how to replace multiple whit space with ", ".

2005-09-02 Thread Bernard van de Koppel
Hi, Both solutions work great $omschrijving=~s/ +/, /g; $omschrijving=~s/\s+/, /g; Many thanks, Bernard On Wednesday 31 August 2005 02:18, John W. Krahn wrote: > Bernard van de Koppel wrote: > > Hi, > > Hello, > > > How can I replace multiple white space with ", " (comma space). > > > > "this

Re: Escaping with tr

2005-09-02 Thread Bernard van de Koppel
Hi, Thanks for the warning. As far as the specs are, a semicolon is not allowed as data in the datastream (yet) (of an electronic banking backend application). Some files however don't use the doublequote combined with the semicolon, but just the semicolon to identify fields. So far the se

Re: $ or % For Associative Arrays?

2005-09-02 Thread John W. Krahn
Mark Sargent wrote: > Hi All, Hello, > am new to Perl. I'm followig this tutorial, > > http://www.cs.unc.edu/~jbs/resources/perl/perl-basics/variables.html That web site was last updated 8 years ago and is talking about Perl4 while the current version of Perl is 5.8. And even if you are still

creating a daemon

2005-09-02 Thread Octavian Rasnita
Hi, I have made a simple daemon using Net::Daemon but if the client sends a content that has more lines, the daemon takes each line as a separate content. Are there any methods to specify that all the lines starting from a certain special character and ending on another special character are a par

RE: $ or % For Associative Arrays?

2005-09-02 Thread Thomas Bätzler
Hello Mark, > am new to Perl. I'm followig this tutorial, > > http://www.cs.unc.edu/~jbs/resources/perl/perl-basics/variables.html > > and am confused as to why the below shows examples with $ and > some with % at the beginning of the statement. When it says, > "Perl uses the "percent" symbol

$ or % For Associative Arrays?

2005-09-02 Thread Mark Sargent
Hi All, am new to Perl. I'm followig this tutorial, http://www.cs.unc.edu/~jbs/resources/perl/perl-basics/variables.html and am confused as to why the below shows examples with $ and some with % at the beginning of the statement. When it says, "Perl uses the "percent" symbol and curly braces