Re: Assigning an array to a dereferenced hash slice - syntax!

2009-03-11 Thread Chas. Owens
On Thu, Mar 12, 2009 at 01:27, Chap Harrison wrote: > On Mar 11, 2009, at 11:51 PM, Chas. Owens wrote: > >> Dereference the hashref as an arrayref then ask for the keys: >> >> #!/usr/bin/perl >> >> use strict; >> use warnings; >> >> my %hash = ( adams => {} ); >> >> my @keys   = qw/a ar af aw/; >>

Re: Assigning an array to a dereferenced hash slice - syntax!

2009-03-11 Thread John W. Krahn
Chap Harrison wrote: On Mar 11, 2009, at 11:51 PM, Chas. Owens wrote: Dereference the hashref as an arrayref then ask for the keys: #!/usr/bin/perl use strict; use warnings; my %hash = ( adams => {} ); my @keys = qw/a ar af aw/; my @values = (1, 19, 13, 11); @{$hash{adams...@keys} = @val

Re: Assigning an array to a dereferenced hash slice - syntax!

2009-03-11 Thread John W. Krahn
Chap Harrison wrote: Hello, Hello, I have a hash of hashes, and I'm trying to bulk-assign some key/value pairs to the referenced hash, using a technique I read on the perlmonks list (hash slices, see link below). I've never been good at working out syntax where complex data structures are

Re: Assigning an array to a dereferenced hash slice - syntax!

2009-03-11 Thread Chap Harrison
On Mar 11, 2009, at 11:51 PM, Chas. Owens wrote: Dereference the hashref as an arrayref then ask for the keys: #!/usr/bin/perl use strict; use warnings; my %hash = ( adams => {} ); my @keys = qw/a ar af aw/; my @values = (1, 19, 13, 11); @{$hash{adams...@keys} = @values; use Data::Dumper

Re: Assigning an array to a dereferenced hash slice - syntax!

2009-03-11 Thread Chas. Owens
On Thu, Mar 12, 2009 at 00:19, Chap Harrison wrote: > Hello, > I have a hash of hashes, and I'm trying to bulk-assign some key/value pairs > to the referenced hash, using a technique I read on the perlmonks list (hash > slices, see link below).  I've never been good at working out syntax where > c

RE: Stupid newb question

2009-03-11 Thread David Christensen
Neal wrote: > I am starting to learn Perl as the ksh scripting language > My environment is AIX 5.3 running some sort of 5.8 PERL. I was struggling trying to learn Perl via DJGPP on Windows 95 (?) and Programming Perl: http://oreilly.com/catalog/9780596000271/index.html Programming Perl is

Assigning an array to a dereferenced hash slice - syntax!

2009-03-11 Thread Chap Harrison
Hello, I have a hash of hashes, and I'm trying to bulk-assign some key/value pairs to the referenced hash, using a technique I read on the perlmonks list (hash slices, see link below). I've never been good at working out syntax where complex data structures are concerned, and this eludes

Re: My confusion about if ( /grep $desc/ )

2009-03-11 Thread kevin liu
Yes, that's what I am doing right now. The question is just one of my thought. Thank you. On Wed, Mar 11, 2009 at 5:44 PM, Victor Tsang wrote: > kevin, > To answer your question, the 'greb' in your code is just part of a string, > it won't produce any effect. > > and if what you wish is to remove

Re: unable to connect to all the hosts using Net::SSH2 module

2009-03-11 Thread Gunnar Hjalmarsson
monnappa appaiah wrote: Below is the script to login to multiple hosts and then execute the command and give the ouput in text file This script will login to all the hosts in input.txt(this file contains around 137 hosts) but when i run the scriptits giving me output for only 5 hosts wherea

Re: Stupid newb question

2009-03-11 Thread John W. Krahn
neckha...@penntraffic.com wrote: Hi guys, Hello, I am starting to learn Perl as the ksh scripting language (which I don't know either) looks less than powerful. I have used C many years ago, and write my stuff in REXX on a mainframe, so Perl looks like the best of both worlds. My environmen

RE: Network Printing using a Perl Script

2009-03-11 Thread Wagner, David --- Senior Programmer Analyst --- CFS
-Original Message- > From: Aglipay, Recelyn [mailto:recelyn.agli...@ehmc.com] > Sent: Wednesday, March 11, 2009 15:35 > To: beginners@perl.org > Subject: Network Printing using a Perl Script > > Hello everyone, > > > > I'm a beginner and having some issues with a Perl Script I had wr

Re: Network Printing using a Perl Script

2009-03-11 Thread John W. Krahn
Aglipay, Recelyn wrote: Hello everyone, Hello, I'm a beginner and having some issues with a Perl Script I had written for work. I am trying to print to a network label printer. I've verified that the printer is working on its own. But when I try to print to it using Perl nothing happens. He

Re: Stupid newb question

2009-03-11 Thread Jim Gibson
On 3/11/09 Wed Mar 11, 2009 11:36 AM, "neckha...@penntraffic.com" scribbled: > Hi guys, > > I am starting to learn Perl as the ksh scripting language (which I > don't know either) looks less than powerful. > > I have used C many years ago, and write my stuff in REXX on a > mainframe, so Perl

Stupid newb question

2009-03-11 Thread NEckhardt
Hi guys, I am starting to learn Perl as the ksh scripting language (which I don't know either) looks less than powerful. I have used C many years ago, and write my stuff in REXX on a mainframe, so Perl looks like the best of both worlds. My environment is AIX 5.3 running some sort of 5.8 PERL. O

Network Printing using a Perl Script

2009-03-11 Thread Aglipay, Recelyn
Hello everyone, I'm a beginner and having some issues with a Perl Script I had written for work. I am trying to print to a network label printer. I've verified that the printer is working on its own. But when I try to print to it using Perl nothing happens. Here is a copy of my code. I ge

Re: Regex problem, #.*# on new line

2009-03-11 Thread John W. Krahn
Brent Clark wrote: Hiya Hello, I got a string like so, and for the likes of me I can get regex to have it that each line is starts with #abc#. my $a = "#aaa#message:details;extra:info;variable:times;#bbb#message:details;extra:info;variable:times;#ccc#not:always;the:same;ts:14:00.00;"; $

Re: Regex problem

2009-03-11 Thread Chas. Owens
On Wed, Mar 11, 2009 at 12:53, howa wrote: > Hello, > > On Mar 12, 12:34 am, jimsgib...@gmail.com (Jim Gibson) wrote: >> That will test if $a starts with 'html' or 'jpg'. To test for a non-match, >> use the !~ operator: >> > > I can't, since I will add more criteria into the regex, > > e.g. > > I

Re: Regex problem

2009-03-11 Thread howa
Hello, On Mar 12, 12:34 am, jimsgib...@gmail.com (Jim Gibson) wrote: > That will test if $a starts with 'html' or 'jpg'. To test for a non-match, > use the !~ operator: > I can't, since I will add more criteria into the regex, e.g. I need to match a.* , except a.html or a.jpg if ( $a =~ /a\.(

Re: OO constructors

2009-03-11 Thread Dermot
2009/3/11 Jim Gibson : > On 3/11/09 Wed  Mar 11, 2009  5:28 AM, "Dermot" > scribbled: > >> 2009/3/11 Dr.Ruud : >>> Dermot wrote: >>> I created  a small Class, initially with Moose. When I wanted an instance of the class I would call `my $instance = new MyClass`; I then removed

Re: OO constructors

2009-03-11 Thread Jim Gibson
On 3/11/09 Wed Mar 11, 2009 5:28 AM, "Dermot" scribbled: > 2009/3/11 Dr.Ruud : >> Dermot wrote: >> >>> I created  a small Class, initially with Moose. When I wanted an >>> instance of the class I would call `my $instance = new MyClass`; >>> >>> I then removed Moose  and went for a standard Pe

Re: Regex problem

2009-03-11 Thread Jim Gibson
On 3/10/09 Tue Mar 10, 2009 8:41 PM, "howa" scribbled: > Hi, > > On Mar 11, 1:16 am, nore...@gunnar.cc (Gunnar Hjalmarsson) wrote: >> >> I would do: >> >>      if ( $a =~ /\.(?:html|jpg)$/i ) >> >> Please readhttp://perldoc.perl.org/perlretut.htmland other appropriate >> docs. > > Read the

Regex problem, #.*# on new line

2009-03-11 Thread Brent Clark
Hiya I got a string like so, and for the likes of me I can get regex to have it that each line is starts with #abc#. my $a = "#aaa#message:details;extra:info;variable:times;#bbb#message:details;extra:info;variable:times;#ccc#not:always;the:same;ts:14:00.00;"; $a =~ s/(?join( "\n", split(/#.*

Re: Library for iso8583 message !

2009-03-11 Thread Chung vu
Thanks Bob , Do you know any solution concerned with library that is parsed , analyzed iso 8583 message Regards, Chung On Wed, Mar 11, 2009 at 5:46 PM, Bob goolsby wrote: > You might take a look at PerlPOS -- http://www.perlpos.com/ > > > OBG > > On Wed, Mar 11, 2009 at 3:36 AM, Chung vu wrote

Re: My confusion about if ( /grep $desc/ )

2009-03-11 Thread Victor Tsang
kevin, To answer your question, the 'greb' in your code is just part of a string, it won't produce any effect. and if what you wish is to remove your own grep process, this command might do the trick. ps -ef | grep hald-runner | grep -v grep Tor. kevin liu wrote: Hello everyone: When

Re: OO constructors

2009-03-11 Thread Dermot
2009/3/11 Dr.Ruud : > Dermot wrote: > >> I created  a small Class, initially with Moose. When I wanted an >> instance of the class I would call `my $instance = new MyClass`; >> >> I then removed Moose  and went for a standard Perl 00 constructor: >> >> sub new { >>  my $class = shift; >>  my $self

Re: OO constructors

2009-03-11 Thread Dr.Ruud
Dermot wrote: I created a small Class, initially with Moose. When I wanted an instance of the class I would call `my $instance = new MyClass`; I then removed Moose and went for a standard Perl 00 constructor: sub new { my $class = shift; my $self = {}; $self->{config} = _get_config();

Re: Regex problem

2009-03-11 Thread howa
Hi, On Mar 11, 1:16 am, nore...@gunnar.cc (Gunnar Hjalmarsson) wrote: > > I would do: > >      if ( $a =~ /\.(?:html|jpg)$/i ) > > Please readhttp://perldoc.perl.org/perlretut.htmland other appropriate > docs. Read the doc, but how to negate the "Non-capturing groupings" ? use strict; my $a = '

Re: Library for iso8583 message !

2009-03-11 Thread Bob goolsby
You might take a look at PerlPOS -- http://www.perlpos.com/ OBG On Wed, Mar 11, 2009 at 3:36 AM, Chung vu wrote: > Hi all, > In java , we have jpos framework for is8583 processing . > Does we have library for processing iso8583 in perl ? > Thanks a lot ! > Regards, > Chung > -- To unsubscribe

Library for iso8583 message !

2009-03-11 Thread Chung vu
Hi all, In java , we have jpos framework for is8583 processing . Does we have library for processing iso8583 in perl ? Thanks a lot ! Regards, Chung

Re: My confusion about if ( /grep $desc/ )

2009-03-11 Thread John W. Krahn
kevin liu wrote: Hello everyone: Hello, When I am using a pattern match to find my wanted process, things like this: * ps -ef | grep hald-runner root 5006 5005 0 Mar04 ?00:00:00 hald-ru

OO constructors

2009-03-11 Thread Dermot
Hi, I created a small Class, initially with Moose. When I wanted an instance of the class I would call `my $instance = new MyClass`; I then removed Moose and went for a standard Perl 00 constructor: sub new { my $class = shift; my $self = {}; $self->{config} = _get_config(); bless ($se

Re: My confusion about if ( /grep $desc/ )

2009-03-11 Thread Erez Schatz
2009/3/11 kevin liu : >   �...@array = qx{ps -ef | grep hald-runner}; >    chomp @array; >    foreach ( @array ) { >        if (/grep hald-runner/) { >            next; >        } >    } > >    Here my confusion comes: What the grep here will mean?? >    Here "grep" is just a plain text or a verb w

My confusion about if ( /grep $desc/ )

2009-03-11 Thread kevin liu
Hello everyone: When I am using a pattern match to find my wanted process, things like this: * ps -ef | grep hald-runner root 5006 5005 0 Mar04 ?00:00:00 hald-runner kevin