RE : RE : RE : Regular expressions #2

drieux is right about me being exploring Perl. In fact, that is a good =
exercice to play with regular expressions and data types as I had to =
build a hash of hashes to do the thing.

However, I wouldn't let a script in that stat if I knew of a =
better/quicker/shorter method.

I will then have to improve my script soon.

What would be the best way to put values returned by the ps command you =
just mentionned in variables?

Thanks again for your great help.=20

P.S : I look like the typical lazy guy who don`t even read and try by =
himself. This is because I am at work, and overloaded with other things, =
and as you know bosses, I made the mistake to tell him that I would do =
that little thing in Perl, he know thinks that I am a Perl guru! I've =
started reading a Perl5 book by the evenings, so, I do my homework in =
some way :-)

I appreciate your help. Thanks again,

Best regards,

Steve Hemond
Programmeur Analyste / Analyst Programmer
Smurfit-Stone, Ressources Foresti=E8res
La Tuque, P.Q.
Tel.: (819) 676-8100 X2833
shemond@smurfit.com=20



 > -----Original Message-----
 > From: drieux [mailto:drieux@wetware.com]=20
 > Sent: Wednesday, December 17, 2003 2:04 PM
 > To: Perl Perl
 > Subject: Re: RE : RE : Regular expressions
 >=20
 >=20
 >=20
 > On Dec 17, 2003, at 10:40 AM, Wiggins d Anconia wrote:
 > [..]
 > > Ah!  And now we have come full circle back to "Why you=20
 > should use a=20
 > > module to handle this type of code rather than re-inventing the=20
 > > wheel!"....
 > [..]
 >=20
 > technically I agree with you. In terms of code re-use
 > and code maintainability. So it sorta depends upon
 > what the 'real goal' is all about...
 >=20
 > There is also the minor point,
 > that some times doing silly things that
 > are better covered in an already established
 > module will help folks 'get it' about what
 > they are doing and how they can do things.
 >=20
 > In this case steve Thought that his problem
 > was with his lack of knowledge about 'regular expression'
 > and how to do that. When his issue was with how to
 > effectively use split() - one of the variants that
 > he could have used of course would have been
 >=20
 > 	my ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd,@args) =3D split;
 >=20
 > But that would have meant dealing with @args problem
 > where he needed to find TWO things in an array in a
 > given order, rather than merely regExing a longer scalar.
 >=20
 >=20
 >=20
 > ciao
 > drieux
 >=20
 > ---
 >=20
 >=20
 > --=20
 > To unsubscribe, e-mail: beginners-unsubscribe@perl.org
 > For additional commands, e-mail: beginners-help@perl.org=20
<http://learn.perl.org/> <http://learn.perl.org/first-response>

0
SHEMOND
12/17/2003 7:38:35 PM
perl.beginners 29388 articles. 4 followers. Follow

0 Replies
1109 Views

Similar Articles

[PageSpeed] 30
Get it on Google Play
Get it on Apple App Store

Reply:

Similar Artilces:

RE : RE : RE : RE : Regular expressions #2
No worries :-) It works now, thanks a lot :-) Best regards, Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Foresti=E8res La Tuque, P.Q. Tel.: (819) 676-8100 X2833 shemond@smurfit.com=20 > -----Original Message----- > From: drieux [mailto:drieux@wetware.com]=20 > Sent: Wednesday, December 17, 2003 1:38 PM > To: Perl Perl > Subject: Re: RE : RE : RE : Regular expressions >=20 >=20 >=20 > On Dec 17, 2003, at 10:24 AM, drieux wrote: >=20 > > > > open(PS, "ps -efA|") or...

RE : RE : RE : RE : Regular expressions
Here is a sample of what your piece of code returns on my Aix box. 44520 -> /prog/gena/8.1.1/bin/dispatch 44650 -> reproject 45176 -> aioserver 45432 -> aioserver 45724 -> -ksh 46002 -> /bin/bsh 46232 -> /usr/dt/bin/dtterm 46584 -> /usr/bin/ksh 46820 -> /usr/dt/bin/ttsession 47060 -> /bin/bsh 47304 -> /usr/dt/bin/dtlogin 47396 -> /usr/dt/bin/dtterm 47722 -> dtfile 47942 -> /usr/dt/bin/dtsession 48272 -> dtfile 48568 -> ora_cjq0_gist 48758 -> gxtrackd 49032 -> dtwm 49330 -> /usr/lib/lpd/pio/etc/piohpnpf 49592 -> b...

RE : RE : RE : Regular expressions
I am issuing this command on an Aix box and running allright :-) Forgive my curiosity.. are you running Solaris on a x86 box?=20 Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Foresti=E8res La Tuque, P.Q. Tel.: (819) 676-8100 X2833 shemond@smurfit.com=20 > -----Original Message----- > From: drieux [mailto:drieux@wetware.com]=20 > Sent: Wednesday, December 17, 2003 1:14 PM > To: Perl Perl > Subject: Re: RE : RE : Regular expressions >=20 >=20 >=20 > On Dec 17, 2003, at 8:47 AM, Hemond, Steve wrote: ...

RE: Spam:RE: Spam:Re: Using regular expressions
Erps... Just re-read where you said: > You imply above that you will read the file "a line at a time" however > using a for loop will read the whole file into a list in memory. You=20 > need to use a while loop to read a line at a time. .... And you're right... :) Regards, =20 Michael S. E. Kraus Software Developer Wild Technology Pty Ltd _______________________________ ABN 98 091 470 692 Level 4 Tiara, 306/9 Crystal Street, Waterloo NSW 2017, Australia Telephone 1300-13-9453 | Facsimile 1300-88-9453 http://www.wildtechnology.net =20 The in...

RE : RE : Regular expressions
I think I begin to understand... I begin by fetching the results of the ps -efA command and split it into = many variables ($uid, $pid, etc.) open(PS, "ps -efA|");=20 while (<PS>) {=20 ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) =3D split; =20 if ($cmd =3D~ /dispatch genie/) { $infos{$pid}{'uid'} =3D $uid; $infos{$pid}{'ppid'} =3D $ppid; $infos{$pid}{'c'} =3D $c; $infos{$pid}{'stime'} =3D $stime; $infos{$pid}{'tty'} =3D $tty; $infos{$pid}{'time'} =3D $time;...

Re: Re:
Sorry about that, my mistake, the patched method goes like this: procedure DeallocateHWnd(Wnd: HWND); var Instance: Pointer; begin Instance := Pointer(GetWindowLong(Wnd, GWL_WNDPROC)); if Instance <> @DefWindowProc then begin { make sure we restore the default windows procedure before freeing memory } SetWindowLong(Wnd, GWL_WNDPROC, Longint(@DefWindowProc)); FreeObjectInstance(Instance); end; DestroyWindow(Wnd); end; "Andreas Hausladen" <AndreasDOTHausladen@gObviousToBeRemovedmx.de> wrote in message news:99620@f...

RE: Re: [wxperl-users] Re: Re: EVT_QUERY_END_SESSION
you putted the EVT_CLOSE to the wrong place... or do you have a reason why you need it to be there? $app ist not the window, but you could use EVT_CLOSE on $frame too. i changed your minimal sample that it works. hope it helps greeting Marco ---- use Wx; ########################### package MyApp; use strict; use vars qw(@ISA); @ISA=qw(Wx::App); sub OnInit { my( $this ) = @_; my( $frame ) = MyFrame->new( "Minimal wxPerl app", Wx::Point->new( 50, 50 ), Wx::Size->new( 450, 350 ) ); ...

Re: Re: Re: RE: capture a website and process its data
--Next_1077222091---0-202.54.124.153-17281 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Rob,=0AI implemented your code and it gave perfectly desired answers. Bu= t I couldn't understand most of it. So, currently I went ahead with Dan's t= ips on my code only and would try to understand your code later after I mee= t a deadline for a small project of mine in college for tomorrow! So, no qu= estions as of now. =0A=0Acheers.=0AK(ay).=0A=0A=0AOn Thu, 19 Feb 2004 Rob D= ixon wrote :=0A>Scott E Robinso...

Re: Re: Re: Re: cross cluster read fails
--Boundary_(ID_HDBIpKP7HBB79jluGvYvuw) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT Content-disposition: inline �Hi Alan One more thing before we go further :) I wrote a simple perl script that accepts a file name, prints it out, opens the file (dies if open unsuccessful or prints �open successful�) 1>I passed my local directory filename, it prints �open successful� 2> Now I just add �abcd::� in front of it, and the perl script fails with Remote node is unknown D...

RE: Re: Re: Sub not working as it should
You don't need to be sorry - it's the right choice ;-) Philipp > -----Original Message----- > > I am sorry I am migrating over to perl (love the built > in debugger) > --- Saadat Saeed <saadat_saeed@yahoo.com> wrote: > > Thanks for the quick reponse - looks like I confuse > > my > > vbscript skills a bit... I am new to perl and am > > migrating over to vbscript! > > > > Regards > > > > > > --- Jeff 'japhy' Pinyan <japhy@perlmonk.org> wrote: > > > On Jan 21, Saadat S...

RE: RE: Re: Tri-grams?
------_=_NextPart_001_01C6380E.13FCCC91 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable -----Original Message----- From: amit hetawal [mailto:amit_h123@rediffmail.com] Sent: Wednesday, February 22, 2006 16:00 To: Wagner, David --- Senior Programmer Analyst --- WGO Subject: Re: RE: Re: Tri-grams? hi there the sequnce with alpha _ _ is valid but not _ _ _ I replaced the 4 four lines in your program with the following four line= s. =20 next if ( $char !~ /[a-z]/i ); my $char2 =3D substr $_, $ii+1, 1; ...

RE: Spam:Re: Using regular expressions
John, Lighten up matey... The examples I've given are just that examples... Error checking functionality is up the end programmer... (And you are quite right, you should check the status of operations.) This is a beginers list, let's keep it friendly, eh? .... and FWIW ... for my $line (<INFILE>) { # stuff } is equivalent to: while (my $line =3D <INFILE>) { # stuff } If you are going to correct me, at least get it right and do it in a friendly manner! ;) :P :) Regards, =20 Michael S. E. Kraus Software Developer Wild Technology Pty ...

Re: Re-inventing the wheel [was RE: Why not gmp? [was Re: pdd14 -- bignums] ]
Simon Cozens <simon@netthink.c To: Shlomi Fish <shlomif@vipe.technion.ac.il> o.uk> cc: perl6-internals@perl.org ...

RE: RE: RE: RE: [wxperl-users] wxTreeCtrl, edit an treeItem
>>Found a fix ( I hope ); download the modified wx22_9.dll from >>http://wwwstud.dsi.unive.it/~mbarbon/wx/wx22_9.dll.gz >>uncompress it and put it in $PERL/site/lib/auto/Wx >>( make a backup of the original one, of course ). >>This fixes your problem with tree control, but may introduce >>new ones ( it is a fix backported from wxWIndows 2.3 ). >> >>Regards >>Mattia > >hey thanks man! >i had no time to work on my application but i checked the wxwindows >mailinglist archive. you asked for a code change as workaround......

Web resources about - RE : RE : RE : Regular expressions #2 - perl.beginners

Expression (sign language) - Wikipedia, the free encyclopedia
Signs with two different expressions. The pursed lips and partly closed eyes on the left, and raised lip on the right, are necessary for proper ...

Carmen Sweet by Natalie Weir for Expressions Dance Company at the Q
Less is more in this powerfully impressive dance show. Carmen Sweet , Expressions Dance Company. Choreography: Natalie Weir. Music: Rodion Shchedrin​, ...

Joe Rogan's Facial Expression After Ronda Rousey Got Knocked Out Was Priceless - Bleacher Report
Joe Rogan 's face spoke for us all Saturday night. After UFC superstar Ronda Rousey got knocked out by a lethal kick from Holly Holm, the commentator ...

Jack Dorsey: 'Twitter stands for freedom of expression'
Newly-instated CEO Jack Dorsey laid out Twitter's commitment to open dialogue, in a keynote on stage at today's Twitter Flight developer conference ...

Make your technology a force for musical expression with this digital guitar
Computers, tablets, even iPhones have grown into powerful tools for music making, but for many who play guitar the bridge from analog instrument ...

Computers learn how to spot hidden facial expressions
Machines are good at spotting obvious emotions like smiles, but they're not so hot at detecting the extremely brief microexpressions that reveal ...

Smile!: Impressive Real-Time Facial Expression Transfer
This is a video from Stanford University of a system developed to transfer one person's facial expressions in real time to a live video feed ...

How Facial Recognition Uses Super-Simple Patterns to Understand Your Expression
Facial recognition systems use all kinds of clever software to work out who you are and even how you’re feeling. But in this video explainer, ...

Expressions of Solidarity for France in Red, White and Blue
ABC News Expressions of Solidarity for France in Red, White and Blue ABC News This photograph made available on Saturday Nov. 14, 2015, shows ...

Black Activist Shows His Freedom Of Expression By Punching Christian Preacher In University Of Missouri’s ...
A black activist at the University of Missouri showed his “freedom of expression” towards a Christian pastor who was in the midst of protests. ...

Resources last updated: 11/22/2015 11:10:42 AM