Re: modules

2004-09-30 Thread Chris Devers
On Thu, 30 Sep 2004 [EMAIL PROTECTED] wrote: > Yes it does great thank you! But a few more things. Once I > create my code, how do I pass a data file in a different program to a > specific routine that lives in a different file? That's really up to you. You can have a way to pass the n

Re: modules

2004-09-30 Thread DBSMITH
Yes it does great thank you! But a few more things. Once I create my code, how do I pass a data file in a different program to a specific routine that lives in a different file? am I supposed to respond and post at the bottom of you answer? Derek B. Smith OhioHealth IT Chris Dever

Re: modules

2004-09-30 Thread Chris Devers
On Thu, 30 Sep 2004 [EMAIL PROTECTED] wrote: > I am unsure if I pissed everyone off, b/c no one responded??? Some (all?) of us have jobs and lives that occasionally prevent us from giving out free advice to strangers on the internet immediately. It happens. It isn't meant personally. > I am

launching internet shortcut in Windows with system

2004-09-30 Thread Michael Doucette
I am trying to write a simple script using system() in windows to launch a internet shortcut on my desktop in my browser (Netscape). It works with other application links just not internet shortcuts. Thanks, Mike

modules

2004-09-30 Thread DBSMITH
All, I am unsure if I pissed everyone off, b/c no one responded??? If I did I did not mean to my apologies. Anyway can anyone provide some insight? I am reading Object Oriented Perl pages 52 and 53 for setting up a module. It is telling me in order to use a routine from a different file yo

Re: sum a column

2004-09-30 Thread Wiggins d Anconia
> Hello, > > Im trying to sum up a column from my results. Help. > > current output: > Date_Time, SRCIP, DSTIP, TOTALBYTES > 01-01-2004 12:56:48, 192.168.1.1, 192.168.2.2, 2768 > Sum Of Bytes = 2768 > 01-01-2004 12:56:48, 192.168.2.2, 192.168.1.1, 438 > Sum Of Bytes = 876 > 01-02-2004 16:49:45,

Re: Check for valid email address

2004-09-30 Thread Chris Devers
On Thu, 30 Sep 2004, Denzil Kruse wrote: > And BTW, I usually snip most of the history of the > email threads just to keep it clean. I don't know > what the etiquette is on this list. Do people like to > see the whole conversation? No! Strip messages down to the essentials of what you're reply

Re: difference between "@_" and "shift"

2004-09-30 Thread Chris Devers
On Thu, 30 Sep 2004, John W. Krahn wrote: > Chris Devers wrote: > > > shift is a function for pulling off the first element from a list. > > Wrong! If you try to use shift() with a list it will print out a nice > error message "Type of arg 1 to shift must be array". > > perldoc -q "What is t

Re: sum a column

2004-09-30 Thread rmck
Are you serious. Im not sure how to sum up the column... I tried by using the field and * it by the increment. I have written every part of my script, Im stuck on one part , summing a column Man you need a vacation Gunnar should be Goner... -Original Message- From: Gun

Help with Archive::Zip

2004-09-30 Thread dennis . gray
I have had limited success with using this package but do need some help. Here is my problem: I have a directory containing thousands of .zip files, each with a single text file. The archive files have the name in the format IMBFILE.zip, where is a sequence number. The

Re: difference between "@_" and "shift"

2004-09-30 Thread John W. Krahn
Chris Devers wrote: The former is a variable; the latter is a function. @_ is one of Perl's "pronoun" variables: just as $_ refers to "that" which you were most recently working with, @_ refers to "those" which you were most recently working with. $_ is a scalar -- "it" or "that"; a single thi

Re: sum a column

2004-09-30 Thread Gunnar Hjalmarsson
Rmck wrote: Im trying to sum up a column from my results. Help. Im stuck. I don't believe you. To be stuck, you need to try first, and I suspect that you didn't do that. Note that this is not a free service for modifying scripts that people pick up somewhere. I suggest that you make a serious a

Re: Check for valid email address

2004-09-30 Thread Gunnar Hjalmarsson
Denzil Kruse wrote: I usually snip most of the history of the email threads just to keep it clean. Sounds as common sense to me, and it's probably part of the general 'netiquette' to only quote what's needed to give context. I don't know what the etiquette is on this list. Do people like to see th

sum a column

2004-09-30 Thread rmck
Hello, Im trying to sum up a column from my results. Help. current output: Date_Time, SRCIP, DSTIP, TOTALBYTES 01-01-2004 12:56:48, 192.168.1.1, 192.168.2.2, 2768 Sum Of Bytes = 2768 01-01-2004 12:56:48, 192.168.2.2, 192.168.1.1, 438 Sum Of Bytes = 876 01-02-2004 16:49:45, 192.168.3.3, 192.168.

Re: Check for valid email address

2004-09-30 Thread Denzil Kruse
--- Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > I had a look at the source of Mail::Verify, and even > if the module > claims to verify the syntax, it doesn't really. You > may want to check > out e.g. Email::Valid, too. I already know the email is works because we've sent them before, so I'

Re: printing block of text

2004-09-30 Thread John W. Krahn
Murphy, Ged (Bolton) wrote: I'm trying to print a block of code using 'print < #!/usr/bin/perl print < Can't find string terminator "TEST" anywhere before EOF at photo.pl line 3. Anyone got any ideas as to why it's doing this? perl is looking for a string terminator that looks like "\nTEST\n". You

Re: Need help with script

2004-09-30 Thread John W. Krahn
Paul Johnson wrote: On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: perl -l -00pe's/\n/\t/;s/\"//g;' FILENAME $ perl -MO=Deparse -l00pe's/\n/\t/;s/\"//g' BEGIN { $/ = "\n"; $\ = "\000"; } In your example you have removed the -0 switch so it is doing something completely different. John -- u

Re: Need help with script

2004-09-30 Thread John W. Krahn
Errin Larsen wrote: Hi Perlers, On 30 Sep 2004 10:11:29 +0100, Jose Alves de Castro <[EMAIL PROTECTED]> wrote: On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: I would like the output in the following format object1<...tab>Description1 object2<...tab>Description2 object3<...tab>Descr

Re: Need help with script

2004-09-30 Thread PerlDiscuss - Perl Newsgroups and mailing lists
> Hi again, > Ok, I've got ActiveState on WinXP, 5.8.4 ... I tried and found that I > had the same problems as you. After much playing around, I found it's > a quoting problem on the command line (at least, in my case it was). > I just don't have a good grasp of quoting rules and precedence in D

Re: Check for valid email address

2004-09-30 Thread Gunnar Hjalmarsson
Sano Babu wrote: Gunnar let me ask u a question.. :) DO u ever sleep?? Yeah, it happens. :) U're constantly helping people out here... It seems u never step back from helping :) Well, I'm not alone, right? Actually, there are people for whom that is more true than it is for me, and who have been ar

Re: Configuration File

2004-09-30 Thread Gunnar Hjalmarsson
Errin Larsen wrote: Gunnar Hjalmarsson wrote: Nothing prevents you from declaring @FILE_NAME: package Config; our @FILE_NAME; do "configtest.conf"; print "$_\n" for @FILE_NAME; doesn't that kinda defeat the purpose of declaring the Config name space? Can't see how. It is being decla

Re: Check for valid email address

2004-09-30 Thread Sano Babu
On Thu, 30 Sep 2004 23:58:34 +0200, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Denzil Kruse wrote: > > Gunnar Hjalmarsson wrote: > >> What you can do is testing if the domain/host has an MX record. > >> And you can of course test the syntax, but that's it. > > > > Okay, that sounds like Mail::

Re: Configuration File

2004-09-30 Thread Errin Larsen
On Thu, 30 Sep 2004 23:30:16 +0200, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > > Nothing prevents you from declaring @FILE_NAME: > > package Config; > our @FILE_NAME; > do "configtest.conf"; > print "$_\n" for @FILE_NAME; > > -- > Gunnar Hjalmarsson > Email: http://www.g

Re: Need help with script

2004-09-30 Thread Errin Larsen
On 30 Sep 2004 19:52:31 -, PerlDiscuss - Perl Newsgroups and mailing lists <[EMAIL PROTECTED]> wrote: > I am using Cygwin on Win2K and the version of perl on it is > v5.8.0 > > I am using the same input file, but when I run the command you ran, the > output looks like > > Object1 Description

Re: Check for valid email address

2004-09-30 Thread Gunnar Hjalmarsson
Denzil Kruse wrote: Gunnar Hjalmarsson wrote: What you can do is testing if the domain/host has an MX record. And you can of course test the syntax, but that's it. Okay, that sounds like Mail::Verify then. I had a look at the source of Mail::Verify, and even if the module claims to verify the synta

Re: Check for valid email address

2004-09-30 Thread Denzil Kruse
Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: >I'd say: Forget it. You can't find out whether >an email address is deliverable without asking >the mail server of that address, i.e. >trying to send a message. What you can do is >testing if the domain/host has an MX record. >And you can of cour

Re: Configuration File

2004-09-30 Thread Gunnar Hjalmarsson
Errin Larsen wrote: { package Config; do "configtest.conf" } print "$_\n" for( @Config::FILE_NAME ); Now, this code runs, and produces the expected output. However, it also gives me a warning: Name "Config::FILE_NAME" used only once: possible typo at ./configtest.pl line 7. I realize I can

Re: Need help with script

2004-09-30 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I am using Cygwin on Win2K and the version of perl on it is v5.8.0 I am using the same input file, but when I run the command you ran, the output looks like Object1 Description1 Object2 Description2 Object3 Description3 Thanks Errin Larsen wrote: > > Thanks for your help guys... > > > >

Re: Check for valid email address

2004-09-30 Thread Gunnar Hjalmarsson
Denzil Kruse wrote: I have a bunch of old email addresses in a database and would like to make sure they are deliverable before I try to send anything to them. Does anyone have any ideas or just point me in the right direction? I'd say: Forget it. You can't find out whether an email address is del

Re: How to accumulate Hashes of Array value with the same key?

2004-09-30 Thread Dave Gray
> I have thre HoAs with the same key but different value. > How can I efficiently join the HoA: > > my %HoA = (key1 => ['A',1]); > my %HoA2 = (key1 => ['B',2]); > my %HoA3 = (key1 => ['C',2]); > > into: > > %HoA = (key1 => ['A',1],['B',2],['C',2]); I'm not sure what you want to do here... do yo

Configuration File

2004-09-30 Thread Errin Larsen
Hi Perlers, I'm trying to implement one of the recipes I found in the Perl Cookbook. It is "8.16. Reading Configuration Files" recipe. Here are some snippets from that text: " ... Or better yet, treat the config file as full Perl code: do "$ENV{HOME}/.progrc"; ... The second solution uses do

Re: difference between "@_" and "shift"

2004-09-30 Thread Sano Babu
> Ha, didn't even notice that one, yep $_ is definitely different than > $_[0], which is what the others would have. > > > > > > -- are all equivalent. > > > > I agree. :) > > > > ?? You are agreeing that they are, or aren't? They definitely aren't. hahah..That was a bad post..I mean I agree

Re: difference between "@_" and "shift"

2004-09-30 Thread Wiggins d Anconia
> > So. In the context of subroutine arguments, you're generally passing in > > one or more arguments. If you're only passing one, then you're right -- > > > my $arg = @_; > So what wiggins saying, here $arg has now 1 ? > Yes. It is the length of the array, or "a list taken in scalar context"

Re: difference between "@_" and "shift"

2004-09-30 Thread Sano Babu
> So. In the context of subroutine arguments, you're generally passing in > one or more arguments. If you're only passing one, then you're right -- > my $arg = @_; So what wiggins saying, here $arg has now 1 ? > my $arg = shift; here $arg has now the value of the first element(argument) ?

Re: difference between "@_" and "shift"

2004-09-30 Thread Wiggins d Anconia
> On Thu, 30 Sep 2004, Graeme McLaren wrote: > > > Can anyone tell me what the difference between @_ and shift is? > > So. In the context of subroutine arguments, you're generally passing in > one or more arguments. If you're only passing one, then you're right -- > >my $arg = @_; DANG

Re: difference between "@_" and "shift"

2004-09-30 Thread Wiggins d Anconia
> I am (admitedly) unfamiliar with OO Perl. I understand enough to grok > what you are saying, Wiggins, but I have a question. > > Does a sub (like the one above) have a problem with being called with > & as opposed to not being called with an & with OO Perl? That > questions was worded weird.

Re: difference between "@_" and "shift"

2004-09-30 Thread Sano Babu
On Thu, 30 Sep 2004 20:19:11 +0100, Graeme McLaren <[EMAIL PROTECTED]> wrote: > Hi all, I'm having a look in to object oriented perl. Can anyone tell me > what the difference between @_ and shift is? As far as I know there is no Straight from "the Llama" : @array = qw /dino fred barney/; $a = $s

Check for valid email address

2004-09-30 Thread Denzil Kruse
Hi all, I have a bunch of old email addresses in a database and would like to make sure they are deliverable before I try to send anything to them. I don't need to find each and every bad one, just find most of them. Or at least reduce the undeliverables to a more managable level. I read t

Re: difference between "@_" and "shift"

2004-09-30 Thread Chris Devers
On Thu, 30 Sep 2004, Graeme McLaren wrote: > Can anyone tell me what the difference between @_ and shift is? The former is a variable; the latter is a function. @_ is one of Perl's "pronoun" variables: just as $_ refers to "that" which you were most recently working with, @_ refers to "those"

Re: difference between "@_" and "shift"

2004-09-30 Thread Errin Larsen
I am (admitedly) unfamiliar with OO Perl. I understand enough to grok what you are saying, Wiggins, but I have a question. Does a sub (like the one above) have a problem with being called with & as opposed to not being called with an & with OO Perl? That questions was worded weird. Let me try a

Re: difference between "@_" and "shift"

2004-09-30 Thread Wiggins d Anconia
> Hi all, I'm having a look in to object oriented perl. Can anyone tell me > what the difference between @_ and shift is? One is a variable, one is function/operator ;-) As far as I know there is no > difference except "shift" removes the parameter from the @_ array so if you > were to

difference between "@_" and "shift"

2004-09-30 Thread Graeme McLaren
Hi all, I'm having a look in to object oriented perl. Can anyone tell me what the difference between @_ and shift is? As far as I know there is no difference except "shift" removes the parameter from the @_ array so if you were to "shift" all parameters passed to a function nothing would be c

Re: Need help with script

2004-09-30 Thread Errin Larsen
> Thanks for your help guys... > > But the code is performing the logic only for the first set of lines... > > After the running the above script, the output looks like > > Object1<...tab...>Description1 > > Object2 > Description2 > > Object3 > Description3 Can you post EXACTLY what's in the

RE: Regex:: using variables to hold replacement text

2004-09-30 Thread William Lewis Brown
On Thu, 2004-09-30 at 10:58, Bob Showalter wrote: > William Lewis Brown wrote: > > Hi, > > I have a need to store replacement text for a regex > > substitution in a variable. In other words, I have code in a perl > > script like so:: > > > > $foo =~ s/(.*)bar(.*)/$replacement/g; > > > >

RE: How to accumulate Hashes of Array value with the same key?

2004-09-30 Thread Shaw, Matthew
> > I have thre HoAs with the same key but different value. > > How can I efficiently join the HoA: > > > > my %HoA = (key1 => ['A',1]); > > my %HoA2 = (key1 => ['B',2]); > > my %HoA3 = (key1 => ['C',2]); > > > > into: > > > > %HoA = (key1 => ['A',1],['B',2],['C',2]); > > > > push @{$HoA{key1}},

RE: How to accumulate Hashes of Array value with the same key?

2004-09-30 Thread Shaw, Matthew
> I have thre HoAs with the same key but different value. > How can I efficiently join the HoA: > > my %HoA = (key1 => ['A',1]); > my %HoA2 = (key1 => ['B',2]); > my %HoA3 = (key1 => ['C',2]); > > into: > > %HoA = (key1 => ['A',1],['B',2],['C',2]); > push @{$HoA{key1}}, ( @{$HoA2{key1}}, @{$Ho

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-30 Thread Sano Babu
>> Can you reveal anymore about this, as I read it on stonehenge too. > > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 > > <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> > > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. Does Randal wri

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-30 Thread Gavin Henry
On Thursday 30 Sep 2004 13:19, Randal L. Schwartz wrote: > > "John" == John W Krahn <[EMAIL PROTECTED]> writes: > > John> You might hurt his feelings, he didn't contribute to the third > edition John> of Programming Perl. > > Actually, it's worse than that. I contributed to it, but wasn't cred

Re: How Can I rename File using Perl?..

2004-09-30 Thread Gavin Henry
> Moreover, rename() is a basic part of Perl, so even on Linux there is no > need to do this with a system call to the `mv` command. Of course, doh. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

How to accumulate Hashes of Array value with the same key?

2004-09-30 Thread Edward Wijaya
Hi, I have thre HoAs with the same key but different value. How can I efficiently join the HoA: my %HoA = (key1 => ['A',1]); my %HoA2 = (key1 => ['B',2]); my %HoA3 = (key1 => ['C',2]); into: %HoA = (key1 => ['A',1],['B',2],['C',2]); namely accumulating the value of HoA2,HoA3 into HoA. Thanks very

Re: Need help with script

2004-09-30 Thread Paul Johnson
On Thu, Sep 30, 2004 at 11:26:27AM -0500, Errin Larsen wrote: > When I run your command line up there, I get the following: > > # perl -MO=Deparse -l00pe's/\n/\t/;s/\"//g' > LINE: while (defined($_ = )) { > chomp $_; > s/\n/\t/; > s/"//g; > } > continue { > print $_; > } > -e synt

Re: how do i describe a perl user?

2004-09-30 Thread Sano Babu
On Thu, 30 Sep 2004 11:35:24 -0500, Errin Larsen <[EMAIL PROTECTED]> wrote: > > > On Fri, 1 Oct 2004 01:37:44 +0930, Sano Babu <[EMAIL PROTECTED]> wrote: > > just wondering what a user of Perl may be called? "Perler"?? Theres > > got to be some fancy name for it. Perl is not just another programm

Re: Need help with script

2004-09-30 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Paul Johnson wrote: > On Thu, Sep 30, 2004 at 08:00:41AM -0500, Errin Larsen wrote: > > Hi Perlers, > > On 30 Sep 2004 10:11:29 +0100, Jose Alves de Castro > > <[EMAIL PROTECTED]> wrote: > > > On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: > > > > perl -l -00pe's/n/t/;s/"//g;' FILENAME >

Re: how do i describe a perl user?

2004-09-30 Thread Jose Alves de Castro
On Thu, 2004-09-30 at 17:07, Sano Babu wrote: > just wondering what a user of Perl may be called? I would call him a "very intelligent person" O:-) > "Perler"?? Theres > got to be some fancy name for it. Perl is not just another programming > language.. I reckon its much more like a religion with

Re: how do i describe a perl user?

2004-09-30 Thread Wiggins d Anconia
> On Fri, 1 Oct 2004 01:37:44 +0930, Sano Babu <[EMAIL PROTECTED]> wrote: > > just wondering what a user of Perl may be called? "Perler"?? Theres > > got to be some fancy name for it. Perl is not just another programming > > language.. I reckon its much more like a religion with attitude.. :) > >

Re: how do i describe a perl user?

2004-09-30 Thread Errin Larsen
On Fri, 1 Oct 2004 01:37:44 +0930, Sano Babu <[EMAIL PROTECTED]> wrote: > just wondering what a user of Perl may be called? "Perler"?? Theres > got to be some fancy name for it. Perl is not just another programming > language.. I reckon its much more like a religion with attitude.. :) > > Cheers,

Re: Need help with script

2004-09-30 Thread Errin Larsen
Hi Paul, Thx for the response On Thu, 30 Sep 2004 15:30:06 +0200, Paul Johnson <[EMAIL PROTECTED]> wrote: <> > > Pretty close: > > $ perl -MO=Deparse -l00pe's/\n/\t/;s/\"//g' > BEGIN { $/ = "\n"; $\ = "\000"; } > LINE: while (defined($_ = )) { > chomp $_; > s/\n/\t/; > s/"//g; > }

Re: GetOptions problems

2004-09-30 Thread Chap Harrison
On Sep 30, 2004, at 10:35 AM, cats wrote: yes i know i can not spell, im a dislexic moron If you're like other dyslexics I've known, you're probably (a) not a moron and (b) exceptionally brilliant in other areas. Thanks for the reminder. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: GetOptions problems

2004-09-30 Thread Wiggins d Anconia
> ok ill send again from the correct address... > > >Actually you were probably 'sure', and it is probably failing for some > 'reason'. > ... > > >Start with a spell checker, use punctuation, work on the grammar. Have > a look at: > > yes i know i can not spell, im a dislexic moron > thank you

how do i describe a perl user?

2004-09-30 Thread Sano Babu
just wondering what a user of Perl may be called? "Perler"?? Theres got to be some fancy name for it. Perl is not just another programming language.. I reckon its much more like a religion with attitude.. :) Cheers, SanoBabu -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Open a text file

2004-09-30 Thread Jenda Krynicky
From: Eduardo Vázquez Rodríguez <[EMAIL PROTECTED]> > Thanks Chris I try this and works > >$. = 0; > do > { > $_ = > } > until $. == 5; Looks a bit too involved. Why not just for (1..5); ? > WHILE I believe you meant

Re: Trouble with m///g

2004-09-30 Thread Chap Harrison
On Sep 30, 2004, at 10:41 AM, Jan Eden wrote: my @a = ($foo =~ m'(? Careful, you mistyped the original proposition: my @a = ($foo =~ m'(? Oops, sorry - I copied that into the email from Wiggins' reply, but actually tested with Dave Gray's. Didn't notice the difference. What you posted gives the

Re: Help needed: urgent

2004-09-30 Thread Wiggins d Anconia
> == > Using DBI Perl Programming I get a database o/p as > below > Student SubjectCodeMarks > > A 190 > A

GetOptions problems

2004-09-30 Thread cats
ok ill send again from the correct address... >Actually you were probably 'sure', and it is probably failing for some 'reason'. ... >Start with a spell checker, use punctuation, work on the grammar. Have a look at: yes i know i can not spell, im a dislexic moron thank you i will read the page f

Re: Trouble with m///g

2004-09-30 Thread Jan Eden
Chap Harrison wrote on 30.09.2004: > >On Sep 30, 2004, at 9:55 AM, Wiggins d Anconia wrote: > >> Out of curiousity based on your description shouldn't it return, >> >> ::::::: >> >> Or do you really mean, you are trying to capture all 4 digit strings >> that are not

Re: Trouble with m///g

2004-09-30 Thread Dave Gray
> TIMTOWTDI: > > @list = grep length==4, /\d+/g Shouldn't that be: @list = grep length==4, $foo =~ /\d+/g; Cool solution, I wouldn't have thought to do it that way. I'm getting varying Benchmarking results, though. I think it might have something to do with grep speedups from 5.6.1 to 5.8.0.

Help needed: urgent

2004-09-30 Thread Rohit RS
== Using DBI Perl Programming I get a database o/p as below Student SubjectCodeMarks A 190 A 2

Re: Trouble with m///g

2004-09-30 Thread Chap Harrison
On Sep 30, 2004, at 9:55 AM, Wiggins d Anconia wrote: Out of curiousity based on your description shouldn't it return, ::::::: Or do you really mean, you are trying to capture all 4 digit strings that are not in a string of longer digits? You need to be very explic

Re: Trouble with m///g

2004-09-30 Thread Gunnar Hjalmarsson
Chap Harrison wrote: I'm trying to extract all four-digit numbers from a string in one fell swoop, but I can't seem to come up with the proper regexp. This is my first time using /g in a match so maybe there's a trick I'm missing. For example, the string " aa 444 -

RE: Trouble with m///g

2004-09-30 Thread Bob Showalter
Chap Harrison wrote: > Hi, > > I'm trying to extract all four-digit numbers from a string in one fell > swoop, but I can't seem to come up with the proper regexp. This is my > first time using /g in a match so maybe there's a trick I'm missing. > > For example, the string > > " aa 4

RE: Regex:: using variables to hold replacement text

2004-09-30 Thread Bob Showalter
William Lewis Brown wrote: > Hi, > I have a need to store replacement text for a regex > substitution in a variable. In other words, I have code in a perl > script like so:: > > $foo =~ s/(.*)bar(.*)/$replacement/g; > > The $replacement string needs to contain a "reference" to $1. In >

RE: Need help with script

2004-09-30 Thread Charles K. Clarkson
From: Errin Larsen wrote: [snip] : There! Am I right? This is fun ... we should do this : more often! This taught me a lot. That's one advantage of answering questions on a list like this. You learn while researching the answer. Most of my experience with perl com

Re: Trouble with m///g

2004-09-30 Thread Chap Harrison
Hmmm... m'\b(\d{4})\b'g < aa 444 -> ::: Doesn't give me or . I think the problem has to do with where m///g starts on subsequent iterations. The pattern specifies a delimiter for both the start and the end of the target substring, but

RE: Trouble with m///g

2004-09-30 Thread Wiggins d Anconia
Please bottom post... > I think this might work. > It might, but doesn't. Some testing would be good before posting inaccurate responses. > /\b\d{4}\b/ > \b is matching on boundaries, so you miss the first set, and the set with the 'aa' around them, and then there is the set with the '-'

Re: Trouble with m///g

2004-09-30 Thread Dave Gray
> For example, the string > > " aa 444 -" > > should yield > > , , , , , . That's actually kind of tricky. How about: $aa = " aa 444 -"; @aa = $aa =~ /(?http://learn.perl.org/>

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-30 Thread Craig Harmon
I love your sense of humor! Made my morning. Randal L. Schwartz wrote: "John" == John W Krahn <[EMAIL PROTECTED]> writes: John> You might hurt his feelings, he didn't contribute to the third edition John> of Programming Perl. Actually, it's worse than that. I contributed to it, but wasn't credite

RE: Trouble with m///g

2004-09-30 Thread Hanson, Rob
I think this might work. /\b\d{4}\b/ Rob -Original Message- From: Chap Harrison [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 10:38 AM To: [EMAIL PROTECTED] Subject: Trouble with m///g Hi, I'm trying to extract all four-digit numbers from a string in one fell swoop, bu

Trouble with m///g

2004-09-30 Thread Chap Harrison
Hi, I'm trying to extract all four-digit numbers from a string in one fell swoop, but I can't seem to come up with the proper regexp. This is my first time using /g in a match so maybe there's a trick I'm missing. For example, the string " aa 444 -" should yiel

Re: GetOptions problems

2004-09-30 Thread Wiggins d Anconia
> > > Hello Perl type people > > i am shore i had this working, but its all gone wrong for some resion the > options do not seem to be getting filled. > Actually you were probably 'sure', and it is probably failing for some 'reason'. > can some one please help > 'someone' probably will he

Re: Regex:: using variables to hold replacement text

2004-09-30 Thread Gunnar Hjalmarsson
William Lewis Brown wrote: I have a need to store replacement text for a regex substitution in a variable. In other words, I have code in a perl script like so:: $foo =~ s/(.*)bar(.*)/$replacement/g; The $replacement string needs to contain a "reference" to $1. In other words, the string $replace

RE: printing block of text

2004-09-30 Thread Chris Devers
On Thu, 30 Sep 2004, Murphy, Ged (Bolton) wrote: > I'm trying to print a block of code using 'print < getting an error stating perl can't find the termination label. > Test code and error as follows: > > #!/usr/bin/perl > > print < this is my tester text > TEST > > Can't find string terminator

RE: printing block of text

2004-09-30 Thread Murphy, Ged (Bolton)
>Hi, > >your code works fine for my debian box. >-- >[EMAIL PROTECTED]:~/Stuff$ perl -v > >This is perl, v5.8.3 built for i386-linux-thread-multi >-- Must be the interpreter then. That is weird. This is being written for a Linux box so I'll just comment it out until then. Thanks. ***

Regex:: using variables to hold replacement text

2004-09-30 Thread William Lewis Brown
Hi, I have a need to store replacement text for a regex substitution in a variable. In other words, I have code in a perl script like so:: $foo =~ s/(.*)bar(.*)/$replacement/g; The $replacement string needs to contain a "reference" to $1. In other words, the string $replacement will con

RE: printing block of text

2004-09-30 Thread Gabor Urban
On Thu, 2004-09-30 at 15:39, Murphy, Ged (Bolton) wrote: > >> I'm trying to print a block of code using 'print < >> getting an error stating perl can't find the termination label. > >> Test code and error as follows: > >> > >> #!/usr/bin/perl > >> > >> print < >> this is my tester text > >> TEST

Re: printing block of text

2004-09-30 Thread Paul Johnson
On Thu, Sep 30, 2004 at 02:39:04PM +0100, Murphy, Ged (Bolton) wrote: > >> I'm trying to print a block of code using 'print < >> getting an error stating perl can't find the termination label. > >> Test code and error as follows: > >> > >> #!/usr/bin/perl > >> > >> print < >> this is my tester t

RE: printing block of text

2004-09-30 Thread Murphy, Ged (Bolton)
>> I'm trying to print a block of code using 'print <> getting an error stating perl can't find the termination label. >> Test code and error as follows: >> >> #!/usr/bin/perl >> >> print <> this is my tester text >> TEST >> >> Can't find string terminator "TEST" anywhere before EOF at photo.pl

Re: Need help with script

2004-09-30 Thread Paul Johnson
On Thu, Sep 30, 2004 at 08:00:41AM -0500, Errin Larsen wrote: > Hi Perlers, > On 30 Sep 2004 10:11:29 +0100, Jose Alves de Castro > <[EMAIL PROTECTED]> wrote: > > On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: > > > perl -l -00pe's/\n/\t/;s/\"//g;' FILENAME > > It is my opinion that code

Re: Need help with script

2004-09-30 Thread Errin Larsen
Hi Perlers, On 30 Sep 2004 10:11:29 +0100, Jose Alves de Castro <[EMAIL PROTECTED]> wrote: > On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: > > >>> I would like the output in the following format > > >>> object1<...tab>Description1 > > >>> object2<...tab>Description2 > > >>> object3<.

Re: printing block of text

2004-09-30 Thread Gunnar Hjalmarsson
Ged Murphy wrote: I'm trying to print a block of code using 'print < #!/usr/bin/perl print < Can't find string terminator "TEST" anywhere before EOF at photo.pl line 3. Anyone got any ideas as to why it's doing this? The here-document syntax is described in "perldoc perlop", and the author of that

Re: how to open a file with 666 permission

2004-09-30 Thread Gunnar Hjalmarsson
Bob Showalter wrote: I'm still struggling to think of a real-world situation where a file would _have_ to be created as rw-rw-rw- or rwxrwxrwx. There may be a need to grant more than one user write access. CGI scripts are running as the webserver user by default, and if you let e.g. sendmail start

Re: (when) is the ; required?

2004-09-30 Thread Randal L. Schwartz
> "Chris" == Chris Devers <[EMAIL PROTECTED]> writes: Chris> My impression is that the missing semi-colon is allowed to make it so Chris> that statements like this -- Chris> sub ack { print "Ack! Ack! Mars will rule!" } Chris> -- work as one-liners without having to fuss over another semi

printing block of text

2004-09-30 Thread Murphy, Ged (Bolton)
I'm trying to print a block of code using 'print and then delete this message. Exide Technologies is an industrial and transportation battery producer and recycler with operations in 89 countries. Further information can be found at www.exide.com -- To unsubscribe,

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-30 Thread Randal L. Schwartz
> "John" == John W Krahn <[EMAIL PROTECTED]> writes: John> You might hurt his feelings, he didn't contribute to the third edition John> of Programming Perl. Actually, it's worse than that. I contributed to it, but wasn't credited for it or paid for it. John> Better to buy his latest book

RE: connect through socks

2004-09-30 Thread Jim
> > > Hi perlers, > > > > anyone knows how to connect to a website and download it > through socks > > (ver 4,5) ? I tried IO::Socket::Socks and Net::SOCKS, but I > can't get > > them to work. > > I know it can be done via 'LWP::UserAgent'. Not sure via a > socket though. you could always

RE: how to open a file with 666 permission

2004-09-30 Thread Bob Showalter
Gunnar Hjalmarsson wrote: > Bob Showalter wrote: > > Chris Devers wrote: > > > Maybe the program is a code generator that produces other files > > > which should be executable (I can't remember anyone doing this, > > > but there's no reason why it couldn't be reasonably be done). > > > > Fine, use

GetOptions problems

2004-09-30 Thread cats
Hello Perl type people i am shore i had this working, but its all gone wrong for some resion the options do not seem to be getting filled. can some one please help the program is for searching through a large datafile (poller.cfg) and outputting the found data in a more usefull format. BTW

Re: How Can I rename File using Perl?..

2004-09-30 Thread Chris Devers
On Thu, 30 Sep 2004, Gavin Henry wrote: > Roime bin Puniran said: > > How can i rename any file using PERL?...Where should i start?..Where i > > can find any tutorial? > > using linux: > > man mv > > you can use a system() call or backticks `` The question wasn't how to do this with Linux thou

Re: How Can I rename File using Perl?..

2004-09-30 Thread Jose Alves de Castro
On Thu, 2004-09-30 at 10:20, Roime bin Puniran wrote: > How can i rename any file using PERL?...Where should i start?..Where i can find any > tutorial? Try this perldoc -f rename HTH, :-) jac > This e-mail and any attachments may contain confidential and > privileged information. If you are n

Re: Need help with script

2004-09-30 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: > >>> I would like the output in the following format > >>> object1<...tab>Description1 > >>> object2<...tab>Description2 > >>> object3<...tab>Description3 > >> > >> > >> perl -lne 'BEGIN{$/="\n\n";}s/\n/\t/;print' FILENAME > > > > >

Re: How Can I rename File using Perl?..

2004-09-30 Thread Gavin Henry
Roime bin Puniran said: > How can i rename any file using PERL?...Where should i start?..Where i can find any tutorial? using linux: man mv you can use a system() call or backticks `` > > This e-mail and any attachments may contain confidential and > privileged information. If you are not the i

  1   2   >