Re: SDL beginner question

2011-01-21 Thread Sheppy R
I would recommend using the IRC chat or SDL mailing list found here: http://sdl.perl.org/index.html At least one of the members that is working on the development side is coding on a Mac as well (Unfortunately I don't remember the name). kthakore is generally in the IRC channel most of the time a

Re: SDL beginner question

2011-01-21 Thread Shlomi Fish
Hi Francesco, On Friday 21 Jan 2011 16:20:51 Francesco Di Lorenzo wrote: > Hi everyone, > I've just finished reading Learning Perl by O'Really and I want to learn > something that can give me something more pleasant to work on, something > funny, I want to program some basic games like pong... > F

SDL beginner question

2011-01-21 Thread Francesco Di Lorenzo
Hi everyone, I've just finished reading Learning Perl by O'Really and I want to learn something that can give me something more pleasant to work on, something funny, I want to program some basic games like pong... For this I've found a book that introduces SDL, but I don't know how to install all t

not a beginner question (was Re: regex optimization)

2010-01-04 Thread Uri Guttman
which do regex optimizations all the time. beginners more likely need to know how to write a regex correctly before worrying about their speed, especially when comparing it to another language. so to all of you, think about your question before you post it here. is it really a beginner question?

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Jeff Pang
--- Ryan <[EMAIL PROTECTED]> wrote: > What is a lexical file handle? I'm working my way > through Ford's "Perl > Programming for the Absolute Beginner" (2007) and > Lee's "Beginning Perl" > (2004), and they both use the FH style of file > handle. >From perl 5.6 you can say, open my $fh,"te

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Chas Owens
On 7/19/07, Ryan <[EMAIL PROTECTED]> wrote: What is a lexical file handle? I'm working my way through Ford's "Perl Programming for the Absolute Beginner" (2007) and Lee's "Beginning Perl" (2004), and they both use the FH style of file handle. Should I do differently? snip Yes, you should use

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Ryan
What is a lexical file handle? I'm working my way through Ford's "Perl Programming for the Absolute Beginner" (2007) and Lee's "Beginning Perl" (2004), and they both use the FH style of file handle. Should I do differently? Thanks. --Chris Chas Owens wrote: On 7/19/07, [EMAIL PROTECTED] <

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Chas Owens
On 7/19/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Chas Owens wrote: > On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: >> > >> > when I use while($line1 = ){ >> >$line = ; >> > } >> >

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread John W. Krahn
Chas Owens wrote: On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: > > when I use while($line1 = ){ >$line = ; > } while ($line=) { print"$line"; } 2. while ($line =

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread Chas Owens
On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: > Hi all > > I got started on Perl only today! > I have a text file in which I need to read a line and the line after > that. Like > > line1 and line2 > line2 and line3 > line3 and line4

Re: Extreme beginner question on reading lines from a file.

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 18, 6:16 am, [EMAIL PROTECTED] (Ayesha) wrote: > Hi all > > I got started on Perl only today! > I have a text file in which I need to read a line and the line after > that. Like > > line1 and line2 > line2 and line3 > line3 and line4 > > when I use while($line1 = ){ >

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Rob Dixon
Chas Owens wrote: On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: Hrm, I am confused then:) I have this as a file I am using right now! while () { my @data = split; next unless @data == 3; next if grep (/[^0-9.-]/, @data); printf FILEOUT "X%s Y%s\n", $dat

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Chas Owens
On 7/18/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: Hrm, I am confused then:) I have this as a file I am using right now! while () { my @data = split; next unless @data == 3; next if grep (/[^0-9.-]/, @data); printf FILEOUT "X%s Y%s\n", $data[0], $data[1];

RE: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Joseph L. Casale
uple of coordinates and processes them perfectly? I also am just learning, so I am not sure why I need to do more? Thanks! jlc -Original Message- From: Gary Stainburn [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 18, 2007 10:15 AM To: beginners@perl.org Subject: Re: Extreme beginner

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Gary Stainburn
On Wednesday 18 July 2007 17:08, Joseph L. Casale wrote: > Is that true? > I use while loops and they cycle through each line without me keeping > track? jlc Yeah, it's true. Why would you want to keep track? (you can BTW, look at perldoc perlvar for $.) in my code, the 1st line is written into $

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Jeff Pang
--- Ayesha <[EMAIL PROTECTED]> wrote: > Hi all > > I got started on Perl only today! > I have a text file in which I need to read a line > and the line after > that. Like > > line1 and line2 > line2 and line3 > line3 and line4 > > when I use while($line1 = ){ >$lin

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Gary Stainburn
On Wednesday 18 July 2007 06:16, Ayesha wrote: > Hi all > > I got started on Perl only today! > I have a text file in which I need to read a line and the line after > that. Like > > line1 and line2 > line2 and line3 > line3 and line4 > > when I use while($line1 = ){ >$l

Extreme beginner question on reading lines from a file.

2007-07-18 Thread Ayesha
Hi all I got started on Perl only today! I have a text file in which I need to read a line and the line after that. Like line1 and line2 line2 and line3 line3 and line4 when I use while($line1 = ){ $line = ; } I get output line1 and line2 line3 and l

Re: Beginner question about XML::Simple

2007-04-04 Thread Rob Dixon
Gerben Wierda wrote: I've got a XML file that contains the following snippet

Beginner question about XML::Simple

2007-04-04 Thread Gerben Wierda
I've got a XML file that contains the following snippet Readin

Re: Beginner question

2006-11-30 Thread Junaid Shariff
Thanks Solli. :-)

Re: Beginner question

2006-11-30 Thread Bjørge Solli
On Thursday 30 November 2006 11:14, Junaid Shariff wrote: > Hello again. Thanks for the prompt reply. Not sure if i explained my doubt > clearly. > Basically I run the ncpmount command, which requires the user to enter the > remote server password. But that password has already been entered by the

Re: Beginner question

2006-11-30 Thread Junaid Shariff
Hello again. Thanks for the prompt reply. Not sure if i explained my doubt clearly. Basically I run the ncpmount command, which requires the user to enter the remote server password. But that password has already been entered by the user once before and is stored by me in a variable. Now when I ha

Re: Beginner question

2006-11-30 Thread Gergely Buday
I am new to perl and have a doubt. I have a script that needs to run a command. The command that is being run requires input from the user to proceed. Instead of prompting the user how can I code the utility to not prompt the user but take the input from a variable that has the value that is to be

Re: Beginner question

2006-11-30 Thread Bjørge Solli
Hello and welcome! On Thursday 30 November 2006 10:32, Junaid Shariff wrote: > I am new to perl and have a doubt. I have a script that needs to run a > command. The command that is being run requires input from the user to > proceed. Instead of prompting the user how can I code the utility to not

Beginner question

2006-11-30 Thread Junaid Shariff
Hello, I am new to perl and have a doubt. I have a script that needs to run a command. The command that is being run requires input from the user to proceed. Instead of prompting the user how can I code the utility to not prompt the user but take the input from a variable that has the value that

Re: Beginner question

2005-03-27 Thread Offer Kaye
On Fri, 25 Mar 2005 14:07:02 -0800, Kyle Lampe wrote: > > while ( $lineFile1 = && $lineFile2 = ) { [...snip...] > But it's complaining about my &&. How can I increment the contents of > 2 files like this at once? > According to "perldoc perlop", the && operator has higher precedence than th

Re: Beginner question

2005-03-26 Thread David Kirol
Kyle Lampe wrote: Hello! Hi I've got a quick perl question for you. I'm writing a script that compares two xml files, ignoring one certain tag. The problem I have is I want to get the output from two files simultaneously. What I'm trying is: while ( $lineFile1 = && $lineFile2 = ) { try: while (

Beginner question

2005-03-26 Thread Kyle Lampe
Hello! I've got a quick perl question for you. I'm writing a script that compares two xml files, ignoring one certain tag. The problem I have is I want to get the output from two files simultaneously. What I'm trying is: while ( $lineFile1 = && $lineFile2 = ) { if ( $lineFile1 =~ /$IGNOR

Re: lwp beginner question

2005-03-22 Thread Steven Schubiger
On 22 Mar, "José J. Cintrón" wrote: > The script works fine as long as I'm not behind a proxy. As soon as I > get the script behind the proxy where it will reside it ends with a 500 > Exit code. Anyone can provide me any info on how to get the script > working behind a proxy? You may conside

lwp beginner question

2005-03-22 Thread José J. Cintrón
I'm sure it's a stupid question that has been asked before (probably a few 1000 times), but here it goes any way... I have a script that downloads a file from an ftp site see bellow use strict; # --- Customize here --- my $url = ftp://ftp.server.com/path/";; my $file = "c:\\download\

Re: Use strict (beginner question)

2003-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package name at todaysFiles.pl > line 43. This error means that "$LoginName was declared without

RE: Use strict (beginner question)

2003-04-04 Thread wiggins
On Thu, 3 Apr 2003 14:05:19 -0500, [EMAIL PROTECTED] wrote: > > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package n

Re: Use strict (beginner question)

2003-04-04 Thread Morten Liebach
On 2003-04-03 14:05:19 -0500, [EMAIL PROTECTED] wrote: > > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package name at todaysFiles.pl > line 43. > Global symbol "$TMPNo

Use strict (beginner question)

2003-04-04 Thread Steve . E . Pittman
All, I added the "use strict;" statement to my script for the first time and received the following compilation errors: Global symbol "$LoginName" requires explicit package name at todaysFiles.pl line 43. Global symbol "$TMPNow" requires explicit package name at todaysFiles.pl line 45. Global sym

Re: another beginner question

2002-09-10 Thread drieux
On Tuesday, Sep 10, 2002, at 07:53 US/Pacific, Mike Singleton wrote: > Something like this then??? > === Start === > use constant JOBSTART => 'SNBJH_3203J'; > # Condense start > use constant CONDSTART => 'SNBJH_3403'; > # Job end > use constant JOBEND => 'SNBJH_3211J'; > # Condense end > u

Re: another beginner question

2002-09-10 Thread Mike Singleton
Error: Syntax error, near "CONDEND" == Start === # Job start use constant JOBSTART => 'SNBJH_3203J'; # Condense start use constant CONDSTART => 'SNBJH_3403'; # Job end use constant JOBEND => 'SNBJH_3211J'; # Condense end use constant CONDEND => 'SNBJH_3401J'; # Job cancelled use constant J

Re: another beginner question

2002-09-10 Thread Mike Singleton
Something like this then??? === Start === use constant JOBSTART => 'SNBJH_3203J'; # Condense start use constant CONDSTART => 'SNBJH_3403'; # Job end use constant JOBEND => 'SNBJH_3211J'; # Condense end use constant CONDEND => 'SNBJH_3401J'; # Job cancelled use constant JOBCANC => 'SNBJH_3

Re: another beginner question

2002-09-10 Thread Steve Grazzini
Janek Schleicher <[EMAIL PROTECTED]> wrote: > Mike Singleton wrote at Mon, 09 Sep 2002 19:19:22 +0200: >> ... >> my %statcode = >> ( "$JOBEND" => '0', >> "$CONDEND" => '0', >> "$JOBFAIL" => '-1', >> "$JOBCANC" => '-2', >> ); > > perldoc -q 'What's wrong with always quot

Re: another beginner question

2002-09-09 Thread Janek Schleicher
Mike Singleton wrote at Mon, 09 Sep 2002 19:19:22 +0200: > I think that I have bit off more than I can chew here I hope, it's O.K., if I'll give some other hints: > ... > my $HELP=" > : > > This script must be run on the Backup Express master server. > > "; You could also use a HERE

Re: another beginner question

2002-09-09 Thread Michael Fowler
On Mon, Sep 09, 2002 at 11:24:01AM -0700, david wrote: > also, the way you create your temp file is not reliable. there are better > ways to do what you need. you might want to goto cpan and search for a > module(i can never remember it's name!) that suits your need. You're probably thinking of

Re: another beginner question

2002-09-09 Thread david
Mike Singleton wrote: > I think that I have bit off more than I can chew here > > Error: The process cannot access the file because it is being used by > another process. > > open (OUTF,">$OUT_TEMP") || die "Cannot open output file $!"; > my @files = glob('3*.log'); > $grepexpr = "egrep > \

another beginner question

2002-09-09 Thread Mike Singleton
I think that I have bit off more than I can chew here Error: The process cannot access the file because it is being used by another process. == Script == #!/usr/bin/perl ### # # Copyright (C) 1998 by Syncsort, Inc. #

Re: Beginner question

2002-02-27 Thread Sudarsan Raghavan
Frank 'Olorin' Rizzi wrote: >Hello everybody. > >I am just starting with Perl, >so the following question will probably appear simple to most of you. > >I am trying to get a Perl program to provide me with a listing of the files >stored on the machine (where the program runs). >The environment is

Beginner question

2002-02-27 Thread Frank 'Olorin' Rizzi
Hello everybody. I am just starting with Perl, so the following question will probably appear simple to most of you. I am trying to get a Perl program to provide me with a listing of the files stored on the machine (where the program runs). The environment is a Win machine.. Say I have somethin

Re: beginner question

2001-12-13 Thread Curtis Poe
--- Shawn <[EMAIL PROTECTED]> wrote: > Geez, if your gonna flame a newcomer, at least answer the question while > your at it. This was a flame? > > We just discussed this today. Please do NOT crosspost. This is better in > the [EMAIL PROTECTED] > > list. Further, having a useful subject line

Re: beginner question

2001-12-13 Thread Shawn
t; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, December 13, 2001 4:22 PM Subject: Re: beginner question > We just discussed this today. Please do NOT crosspost. This is better in the [EMAIL PROTECTED] > list. Further, having a useful su

Re: beginner question

2001-12-13 Thread Curtis Poe
We just discussed this today. Please do NOT crosspost. This is better in the [EMAIL PROTECTED] list. Further, having a useful subject line helps. If I had a penny for every unhelpful subject line I've seen today... hold on a minute... I'd have $1.27 :) (tip 'o the keyboard to Terry Pratchet

beginner question

2001-12-13 Thread Lance Prais
use DB_File; tie(@array, "DB_File", "/tmp/textfile", O_RDWR|O_CREAT, 0666, $DB_RECNO) or die "Cannot open file 'text': $!\en" ; $array[4] = "a new line"; untie @array; In the above statment what is the following items refering too? DB_File", O_RDWR|O_CREAT 0666 DB_RECNO --

Not necessarily a beginner question

2001-09-06 Thread Mike Singleton
Where may I find some Perl snippets to calculate the response times on a MSSQL server... not using ping, but actual simple SQL queries?? === Mike Singleton CCNA, CNE, MCSE Network Analyst (253) 272-1916 x1259 (253) 405-1968 (cellular) [EMAIL PROTECTED] DaVita Inc.

RE: RE: Records put into a hash - Beginner Question

2001-06-04 Thread Dave Newton
>> (Original two choices) >> : Is it better to : > > : > > : %Fields = %{$Accts{$account}}; > > : foreach $name ( keys %Fields ) { > > : print "$name : $Fields{$name}\n"; > > : } > > : > > : or > > : > > : foreach $name ( keys %{$Accts{$account}} ) { > > : print "$name : \n"; > > : } > I

Re: RE: Records put into a hash - Beginner Question

2001-06-04 Thread Eduard Grinvald
] (Timothy Kimball) Date: Monday, June 4, 2001 4:00 pm Subject: RE: Records put into a hash - Beginner Question > > Joel Stout wrote: > : Many thanks, one last tidbit: > : Is it better to : > : > : %Fields = %{$Accts{$account}}; > : foreach $name ( keys %Fields ) { > : >

RE: Records put into a hash - Beginner Question

2001-06-04 Thread Timothy Kimball
Joel Stout wrote: : Many thanks, one last tidbit: : Is it better to : : : %Fields = %{$Accts{$account}}; : foreach $name ( keys %Fields ) { : : print "$name : $Fields{$name}\n"; : } : : or : : foreach $name ( keys %{$Accts{$account}} ) { : : print "$name : \n"; : : } I'd say i

RE: Records put into a hash - Beginner Question

2001-06-04 Thread Stout, Joel R
om: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 04, 2001 12:29 PM To: [EMAIL PROTECTED] Subject: Re: Records put into a hash - Beginner Question Joel R. Stout wrote: : #But when I try to pluck a fields value out, I get hosed : : foreach $account (keys %Accts) { :

Re: Records put into a hash - Beginner Question

2001-06-04 Thread Timothy Kimball
Joel R. Stout wrote: : #But when I try to pluck a fields value out, I get hosed : : foreach $account (keys %Accts) { : print "Fields: \n"; : foreach $name (keys $Accts{$account}) { : #here's where my brainstorming turns into a light sprinkle : #there's a scalar here

Records put into a hash - Beginner Question

2001-06-04 Thread Stout, Joel R
#!/usr/bin/perl -w #In page 369 of the Cookbook, I saw that they have a "person" record stored into the scalar "$Nat", like so: $Nat = { "Name" => "Guy Person", "Address" => "123 Itsgee Place", "Age" => 34, }; #Say you indexed this by $AcctNo: $AcctNo = "P123-4

Re: Beginner Question

2001-05-22 Thread Jeff Pinyan
On May 22, Peter Cline said: >> @parts = split ' ', "this and that"; >> { local $" = ") ("; print "(@parts)"; } >> # (this) (and) (that) > >Will the ") (" assign any amount of space to the list separator? >This is interesting. I haven't encountered this syntax before. Using split ' ' is

Re: Beginner Question

2001-05-22 Thread Peter Cline
Thanks for catching my errors. I was thinking too narrowly, using just the one template provided. This can of course be dangerous, for things change. At 05:30 PM 5/22/01 -0400, Jeff Pinyan wrote: >You might want to use the special split ' ' syntax: > > @parts = split ' ', "this and that";

Re: Beginner Question

2001-05-22 Thread Jeff Pinyan
On May 22, Peter Cline said: >Try this. >my $text = "Browser/Version Platform"; >my ($keep,$discard) = split / /, $text; >print "$keep\n"; > >This splits on space and saves the part you want to the variable $keep and >the rest to $discard. Actually, it splits on EXACTLY one space. That can cau

Re: Beginner Question

2001-05-22 Thread Randal L. Schwartz
> "Peter" == Peter Cline <[EMAIL PROTECTED]> writes: Peter> Try this. Peter> my $text = "Browser/Version Platform"; Peter> my ($keep,$discard) = split / /, $text; Peter> print "$keep\n"; Peter> This splits on space and saves the part you want to the variable $keep Peter> and the rest to $dis

Re: Beginner Question

2001-05-22 Thread Peter Cline
Try this. my $text = "Browser/Version Platform"; my ($keep,$discard) = split / /, $text; print "$keep\n"; This splits on space and saves the part you want to the variable $keep and the rest to $discard. Also you could use a regular expression like such: my $text = "Browser/Version Platform"; $

Beginner Question

2001-05-22 Thread Kyrytow, Stefan
I need a way to return the start of a line up to the first whitespace. eg Browser/Version Platform I want just the Browser/Version information returned. It should be simple, but for some reason the solution eludes me. Any help is appreciated, Stefan

Re: Beginner question

2001-05-22 Thread Jeff Pinyan
On May 22, Mark on GCI Server said: >open(TESTER, "print "Enter a username: "; >$input = ; You need to chomp $input, since it has a newline at the end. >$x = 0; >$y = 0; >$w = 0; >$z = 1; >if ( ne "") { That reads a line (and it is lost forever). >while($line = ) { >c

RE: Beginner question

2001-05-22 Thread Wagner-David
]] Sent: Tuesday, May 22, 2001 09:03 To: [EMAIL PROTECTED] Subject: Beginner question Hello all, I'm trying to populate an array from a file, I think I've got the array populated, however, I'm not sure. I then want to compare an input against the array to determine if its there, t

Re: Beginner question

2001-05-22 Thread Jeff Pinyan
On May 22, Mark on GCI Server said: > I'm trying to populate an array from a file, I think I've got the array >populated, however, I'm not sure. I then want to compare an input against >the array to determine if its there, then look at the second component of >each record. Any assistance would

Beginner question

2001-05-22 Thread Mark on GCI Server
Hello all, I'm trying to populate an array from a file, I think I've got the array populated, however, I'm not sure. I then want to compare an input against the array to determine if its there, then look at the second component of each record. Any assistance would be greatly appreciated. Thank

Re: Beginner question

2001-05-22 Thread Aaron Craig
At 11:09 21.05.2001 -0700, you wrote: >if ($oldLot[1] == 0) >{ > $arpCount = $arp{$lot}; ==> Part 1 >} >else >{ > $arpCount = "-"; ==> Part 2 >} > >printf "%3s %3d ", $arpCount, $count; > >My problem occurs in the "printf" at the "%3s". Here >is the situation: When $oldLot[1] =

Re: Beginner question

2001-05-21 Thread Timothy Kimball
: if ($oldLot[1] == 0) : { : $arpCount = $arp{$lot}; ==> Part 1 : } : else : { : $arpCount = "-"; ==> Part 2 : } : : printf "%3s %3d ", $arpCount, $count; : : My problem occurs in the "printf" at the "%3s". Here : is the situation: When $oldLot[1] == 0, $arpCount is : equal to

Beginner question

2001-05-21 Thread Liger-dc
if ($oldLot[1] == 0) { $arpCount = $arp{$lot}; ==> Part 1 } else { $arpCount = "-"; ==> Part 2 } printf "%3s %3d ", $arpCount, $count; My problem occurs in the "printf" at the "%3s". Here is the situation: When $oldLot[1] == 0, $arpCount is equal to an integer, but when $oldLot

RE: Very beginner question

2001-05-09 Thread King, Jason
[EMAIL PROTECTED] writes .. >(name = john) - >if I am trying to just extract "john" for the value $b, why would the >following script not work. I thought it would take bothIt returns the >full (name=john) > >#!user/local/bin/perl -w > >open TRY , "try.txt"; > >while () { > (my $b=$_) =~ s/

Re: Very beginner question

2001-05-09 Thread Brett W. McCoy
On Wed, 9 May 2001 [EMAIL PROTECTED] wrote: > I feel strange putting such a simple question on this list, but then > again, that is why I did not join the experts list. > > Any how, if I have a file called "try.txt" with the following line: > > (name = john) > > if I am trying to just extract "jo

Re: Very beginner question

2001-05-09 Thread Casey West
On Wed, May 09, 2001 at 12:27:26PM -0500, John Joseph Trammell wrote: : On Wed, May 09, 2001 at 01:50:24PM -0400, [EMAIL PROTECTED] wrote: : > #!user/local/bin/perl -w : > : > open TRY , "try.txt"; : > : > while () { : > (my $b=$_) =~ s/^(\() (\w+)/$2/; : > print $b; : > } : > :

Re: Very beginner question

2001-05-09 Thread M.W. Koskamp
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 09, 2001 7:50 PM Subject: Very beginner question > > if I am trying to just extract "john" for the value $b, why would the > following script not work. I thoug

Re: Very beginner question

2001-05-09 Thread John Joseph Trammell
On Wed, May 09, 2001 at 01:50:24PM -0400, [EMAIL PROTECTED] wrote: > #!user/local/bin/perl -w > > open TRY , "try.txt"; > > while () { > (my $b=$_) =~ s/^(\() (\w+)/$2/; > print $b; > } > > Thank you for humiliating me with this simple question. Any time. #!/usr/bin/perl -w use st

Re: Very beginner question

2001-05-09 Thread Peter Cline
I don't quite understand what your regex is intended to do, but if you try tr/()//; s/^.+=//; it should return John as you intend. The tr will remove the parentheses and the substitution will match everything up to the = and substitute it with nothing. alternatively you could do: tr/()// ($f

Re: Very beginner question

2001-05-09 Thread Jeff Pinyan
On May 9, [EMAIL PROTECTED] said: >(name = john) > >if I am trying to just extract "john" for the value $b, why would the >following script not work. I thought it would take bothIt returns the >full (name=john) Let's run your regex through the regex explainer: > (my $b=$_) =~ s/^(\() (\w

Very beginner question

2001-05-09 Thread ODoisnea
I feel strange putting such a simple question on this list, but then again, that is why I did not join the experts list. Any how, if I have a file called "try.txt" with the following line: (name = john) if I am trying to just extract "john" for the value $b, why would the following script not w