parsing Makefiles

2004-02-20 Thread Andrew Gaffney
I'm looking to write a script that will parse a toplevel Makefile in a source tree and then descend into all the directories and parse those Makefiles in order to determine how many 'make' operations will actually be launched. At the moment, I am just playing around, but I intend for this to bec

Re: bless

2004-02-20 Thread R. Joseph Newton
Jacob Chapa wrote: > what does bless do? It gives the hash reference offered as the first argument access to the methods of the package named by the second argument. there is more, but this is an alright place to start. The effect is to turn the hash reference into an object reference. Ideally

Re: $self

2004-02-20 Thread R. Joseph Newton
> drieux wrote: > >> but I am fond of 'my $me' > No, no! Then you'd have to have ", $me $mine;" tacked onto the end to catchy the meter, and that wouldn't be sytactically correct. ( ;-p) Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: $self

2004-02-20 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > No. $self you'll usually see in a lot of Object Oriented applications. When a > subroutine is called using the -> operator ($mw = MainWindow->new, for > example) the first arguement passed to that subroutine is the name of the > package/class. So, $self is usually used t

Re: question plz

2004-02-20 Thread James Edward Gray II
On Feb 20, 2004, at 9:20 PM, [EMAIL PROTECTED] wrote: They're different operators. => is the same thing as the comma. It's sole difference is readability. That's the reason we use it, but it's not the only difference. See below. For example %hash = ( key => "value", key2 => "v

Re: question plz

2004-02-20 Thread WilliamGunther
They're different operators. => is the same thing as the comma. It's sole difference is readability. For example %hash = ( key => "value", key2 => "value2", ); #is the same as %hash = ( key, "value", key2,"value2", ); #is the same as

Re: question plz

2004-02-20 Thread Andrew Gaffney
Jacob Chapa wrote: what is the difference between -> This is used to access hash values through a hash reference and to call module/class functions. and => Its only use is to separate keys and values in a hash definition. Its not even required, though. You can just as easily use a comma. It ju

question plz

2004-02-20 Thread Jacob Chapa
what is the difference between -> and => -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: lc

2004-02-20 Thread Stuart White
The error was: useless use of lc in void context at line 22 I also tried this: lc($input = ); print "$input"; > This won't work though because chomp() returns the > number of newline > characters removed from the string... so in essence > you are trying to > lowercase the number "0" or "1" (the

Re: Capturing output from a command for a GUI

2004-02-20 Thread Mark LoBue
At 12:36 PM 2/20/2004, Benjamin Walkenhorst wrote: >Hello everybody, > >Some time ago I wrote a perl-module to make it easier for me to read and >encode audio-cds. I had done so, planning to write a GUI in Perl/Tk >later. >A few days ago, "Mastering Perl/Tk" arrived, I started playing around >with

all confused about a hash

2004-02-20 Thread DrOwl
Hi all, I am searching through a large data file and pulling out the data for elements that match the IP address... this is at least half working well up to " #just for testing 1" but not after " #just for testing 2", hash %segmentFields is not being populated.

Make file jobs

2004-02-20 Thread stephen kelly
Hi i work in the localisation industry - silly me and am automating a lot of our repititive jobs - we use a lot of regular expressions so i was told to use perl to automate. Silly question - can i run system commands to interact with our sourcesafe database or any other EXE that maybe needed? get t

Re: The biggest file Perl can handle!

2004-02-20 Thread WC -Sx- Jones
Nuno Cardoso wrote: Hi there! I'm trying to parse a 11GB Please post the output of perl -V -Sx- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

The biggest file Perl can handle!

2004-02-20 Thread Nuno Cardoso
Hi there! I'm trying to parse a 11GB tex file with Perl, but he says to me that he can find it. So I try with a 7MB file, and he finds it! So, here's the question: in Perl, is there a size limit for the files open by Perl, so that he becomes confused and says that file doesn't exist, but he

Re: lc

2004-02-20 Thread Jenda Krynicky
From: Stuart White <[EMAIL PROTECTED]> > I want to take input from and then convert it > to lowercase. so I tried this: > > lc(chomp($input = ))); > > and I got an error message that said I couldn't use lc > in that way - or something like that. I can't > remember the message now. > > then I

Re: list of strings to array

2004-02-20 Thread Jenda Krynicky
From: Jacob Chapa <[EMAIL PROTECTED]> > Is there any way to split up a string and put it into an array > > something like this: > > if I had a string: > > one two three four > > or > > one;two;three;four > > Can I put "one" into the first element, "two" into the second, etc... > knowing w

Re: Shebang line

2004-02-20 Thread Paul Johnson
On Fri, Feb 20, 2004 at 05:38:48PM -0500, Robert wrote: > I am on Windows. Is it okay for me to put a unix style shebang line in > my scripts? I would do this for the scripts that I intend to run across > platforms. I think the shebang is mostly ignored on Windows. > > Ex: #!/usr/bin/perl Alth

Re: Shebang line

2004-02-20 Thread WilliamGunther
Yep, in general Unix-style shebang line is fine on Windows. Perl doesn't ignore shebang, the switches are still looked at. Apache uses the shebang on Windows. -Will --- Handy Yet Cryptic Code. Just to Look Cool to Look at and try to decipher without running i

Re: using substr... is this efficient

2004-02-20 Thread Rob Dixon
Luke Bakken wrote: > > From: Larry Sandwick [mailto:[EMAIL PROTECTED] > > > > I have a scripted I wrote that uses *substr* on a file that has fixed > > fields. I have to parse the file before I upload into MYSQL. > > > > Is there a more efficient way other than *substr*, I looked a > > *pack* and >

Shebang line

2004-02-20 Thread Robert
I am on Windows. Is it okay for me to put a unix style shebang line in my scripts? I would do this for the scripts that I intend to run across platforms. I think the shebang is mostly ignored on Windows. Ex: #!/usr/bin/perl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: lc

2004-02-20 Thread WilliamGunther
lc() takes a string, turns the string to lower case, and returns that. So what you're searching for is: chomp($input = lc()); This way, lc() function turns the input into lowercase, assigns it to the $input scalar, and then chomps out the newline at the end. Quite efficent. In a message dated

RE: lc

2004-02-20 Thread Hanson, Rob
> then I tried this: > lc($input); > and I got the same error. This shouldn't give an error. ...It didn't give me one. > so I tried this: > lc(chomp($input = ))); > and I got an error message that said I couldn't use lc > in that way - or something like that. The exact error would be helpful.

lc

2004-02-20 Thread Stuart White
I want to take input from and then convert it to lowercase. so I tried this: lc(chomp($input = ))); and I got an error message that said I couldn't use lc in that way - or something like that. I can't remember the message now. then I tried this: lc($input); and I got the same error. Then I

Re: $self

2004-02-20 Thread drieux
On Feb 19, 2004, at 8:45 PM, Ohad Ohad wrote: No, but it's a cool convention From: Jacob Chapa <[EMAIL PROTECTED]> To: Perl Beginners <[EMAIL PROTECTED]> Subject: $self Date: Thu, 19 Feb 2004 22:23:14 -0600 is $self a special scalar? actually the simpler solutions is sub my_do_foo

Re: how do modules work?

2004-02-20 Thread drieux
On Feb 17, 2004, at 8:33 PM, R. Joseph Newton wrote: Andrew Gaffney wrote: This is what I didn't quite understand. I didn't realize that Perl's "black magic" allowed the blessed reference to refer back to the object already in memory. In effect, the blessed reference carries around the entire clas

Re: Could I put commands in a variable

2004-02-20 Thread James Edward Gray II
On Feb 20, 2004, at 3:31 PM, Guay Jean-Sébastien wrote: On Feb 20, 2004, at 2:02 PM, Joel wrote: Thanks, can you give me some examples of loops like that? Here's one: Nice code James, nicely reusable. Just need to add world file loading and maybe support for items... ;) Thank you. I'll look forw

RE: Could I put commands in a variable

2004-02-20 Thread Guay Jean-Sébastien
> On Feb 20, 2004, at 2:02 PM, Joel wrote: >> Thanks, can you give me some examples of loops like that? >Here's one: Nice code James, nicely reusable. Just need to add world file loading and maybe support for items... ;) But then all you have is a world in which you can move. What about actual ga

RE: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-20 Thread Smith Jeff D
It's working fine and thanks for your help---hopefully my users will welcome the difference. Thanks again. -Original Message- From: James Edward Gray II [mailto:[EMAIL PROTECTED] Sent: Thursday, February 19, 2004 4:42 PM To: Smith Jeff D Cc: '[EMAIL PROTECTED]' Subject: Re: An Old Ques

Re: Could I put commands in a variable

2004-02-20 Thread James Edward Gray II
On Feb 20, 2004, at 2:02 PM, Joel wrote: Thanks, can you give me some examples of loops like that? Here's one: #!/usr/bin/perl use strict; use warnings; # build world as nested hashes my %world = ( Bridge => { Description => 'The Bridge of the spaceship...', Exits => { North => 'Quart

Capturing output from a command for a GUI

2004-02-20 Thread Benjamin Walkenhorst
Hello everybody, Some time ago I wrote a perl-module to make it easier for me to read and encode audio-cds. I had done so, planning to write a GUI in Perl/Tk later. A few days ago, "Mastering Perl/Tk" arrived, I started playing around with simple excercises, until I felt like I knew what I wanted

Re: list of strings to array

2004-02-20 Thread James Edward Gray II
On Feb 20, 2004, at 2:31 PM, Jacob Chapa wrote: Is there any way to split up a string and put it into an array You bet. something like this: if I had a string: one two three four my @words = split ' ', 'one two three four'; # splits on whitespace or one;two;three;four my @words = split /

Does this site have cgi scripting errors?

2004-02-20 Thread Joel
http://www.wildglobe.com/ If everything seems fine, try refreshing the page a bit. I'm curious if that is what it is. Joel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

list of strings to array

2004-02-20 Thread Jacob Chapa
Is there any way to split up a string and put it into an array something like this: if I had a string: one two three four or one;two;three;four Can I put "one" into the first element, "two" into the second, etc... knowing what splits up the string. For instance, in the first one a space

Re: Could I put commands in a variable

2004-02-20 Thread Daniel Staal
--As of Friday, February 20, 2004 8:35 AM -0800, R. Joseph Newton is alleged to have said: I don't know about this Daniel. Even for all its goto's, I found the original more reaable. I actually found his code quite readable, and felt I lost some of that. I felt it a tradeoff worth making at th

Re: Could I put commands in a variable

2004-02-20 Thread Joel
Thanks, can you give me some examples of loops like that? Joel - Original Message - From: "James Edward Gray II" <[EMAIL PROTECTED]> To: "Rob Dixon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, February 20, 2004 12:36 PM Subject: Re: Could I put commands in a variable > On

RE: using substr... is this efficient

2004-02-20 Thread Bakken, Luke
> -Original Message- > From: Larry Sandwick [mailto:[EMAIL PROTECTED] > > I have a scripted I wrote that uses *substr* on a file that has fixed > fields. I have to parse the file before I upload into MYSQL. > > Is there a more efficient way other than *substr*, I looked a > *pack* and >

Re: using substr... is this efficient

2004-02-20 Thread Rob Dixon
Larry Sandwick wrote: > > I have a scripted I wrote that uses *substr* on a file that has fixed > fields. I have to parse the file before I upload into MYSQL. > > Is there a more efficient way other than *substr*, I looked a *pack* and > *unpack* . it did not make any sense to me. > > Here is my co

RE: using substr... is this efficient

2004-02-20 Thread Paul Kraus
> > Is there a more efficient way other than *substr*, I looked a *pack* and > > *unpack* . it did not make any sense to me. Unpack is what I would use. Perldoc unpack. $item = substr($the_line,0,10); $ldesc= substr($the_line,11,40); $page = substr($the_line,52,6); $d=

Re: Could I put commands in a variable

2004-02-20 Thread R. Joseph Newton
Joel wrote: > Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the > same really. > > Joel One thing you may find handy when you restructure is a way to organize your crises: Greetings! E:\d_drive\perlStuff>perl -w sub get_crisis { my $crisis_tag = shift; my $crises = {

using substr... is this efficient

2004-02-20 Thread Larry Sandwick
I have a scripted I wrote that uses *substr* on a file that has fixed fields. I have to parse the file before I upload into MYSQL. Is there a more efficient way other than *substr*, I looked a *pack* and *unpack* . it did not make any sense to me. Here is my code, and any suggestions, comme

RE: Digest::MD5

2004-02-20 Thread Dave Tibbals
> Just for kicks I did a Google search on "installman1 missing > separator" and turned up this: > http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=87682 It suggests setting LANG=en_US before running perl Makefile.PL Does that help? I don't use Linux, so I can't reproduce the problem. > INST

Re: FTP Errors?

2004-02-20 Thread Jas
That worked like a charm. Thanks again... Wiggins D Anconia wrote: Hi Jas. Jas wrote: [snip] $ftp->put(`../path/to/*-www.tar.gz`) or die "Could not transfer files ", $ftp->message; .. backticks in two statements! $ftp->quit; Error... Net::FTP>>> Net::FTP(2.71) Net::FTP>>> Exporter(5.566)

RE: Could I put commands in a variable

2004-02-20 Thread Holcomb, Kevin
Very nicely put James. I am a beginner in Perl and use the group as to gain knowledge and hopefully help me with my scripts. My scripts are pretty simple thou. Just move files around and do naming conversations. Very simple . Keep up the great work on helping us . Thanks, Kevin Holcomb W2K

RE: Digest::MD5

2004-02-20 Thread Bob Showalter
Dave Tibbals wrote: > > What line is make complaining about the missing separator? > > What does the Makefile look like around that line? > > > > From CPAN shell, you can do the following to run the steps > > separately: > > > >look Digest::MD5 > >$ perl Makefile.PL > >$ make > > >

Re: An Old Question on Sorting Hash of Arrays by Array element an d th en by key

2004-02-20 Thread R. Joseph Newton
Smith Jeff D wrote: > Thanks for the feedback--maybe I screwed up but what happens for me is that > the ordered array (1) only lists the keys, not the array values the hash key > points to and (2) I still don't get an ordered list of the keys that are put > in the "ordered" array--it comes out un-

Re: Could I put commands in a variable

2004-02-20 Thread James Edward Gray II
On Feb 20, 2004, at 5:25 AM, Rob Dixon wrote: Hi Daniel. I haven't looked at your code, but I don't think a rewrite is in the spirit of helping beginners at Perl. It may occasionally be the best answer, but I suspect you're simply enjoying yourself here ;) I wonder what others think? I have mixed

Re: all matches of a regex-continued

2004-02-20 Thread Rob Dixon
Öznur tastan wrote: > > - Original Message - > From: "Rob Dixon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, February 20, 2004 4:17 PM > Subject: Re: all matches of a regex-continued > > > > Öznur tastan wrote: > > > > > > I am still dealing with the same problem. > > > Ro

RE: Digest::MD5

2004-02-20 Thread Dave Tibbals
> What line is make complaining about the missing separator? > What does the Makefile look like around that line? > > From CPAN shell, you can do the following to run the steps separately: > >look Digest::MD5 >$ perl Makefile.PL >$ make > This is what I get: [EMAIL PROTECTED] Diges

Re: Could I put commands in a variable

2004-02-20 Thread R. Joseph Newton
Joel wrote: > Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the > same really. > > Joel Looks good! I like the logic overall. I think that once you get your hands on some better syntactic tools, you will be flying right along. You have a bit of reading to do to really ge

RE: Digest::MD5

2004-02-20 Thread Bob Showalter
[redirectinb back to list] Dave Tibbals wrote: >> Dave Tibbals wrote: >>> I am attempting to install the module Digest::MD5 and it fails with >>> the makefile for the module. The error reported is "*** missing >>> separator. Stop". >> >> Something's wrong with the Makefile. This can happen if tab

Re: all matches of a regex-continued

2004-02-20 Thread WC -Sx- Jones
=pod WC -Sx- Jones wrote: Do you want: xHxx yy z t x xxHyy z t as a solution set? Or just those substrings which begin and end with HDK? An example - =cut $_ = 'supercalifragilisticexpialidocious'; # Find ali agili iali print m/i?[la].*?i/g; # Result (one string): aliagiliiali

Re: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
- Original Message - From: "WC -Sx- Jones" <[EMAIL PROTECTED]> To: "Perl Lists" <[EMAIL PROTECTED]> Sent: Friday, February 20, 2004 6:22 PM Subject: Re: all matches of a regex-continued > Öznur Taştan wrote: > > >My problem was this > >I have a sets of patterns > >and a string >

Re: Could I put commands in a variable

2004-02-20 Thread R. Joseph Newton
Joel wrote: > Thanks. > > What does "ne" mean? It's not listed in functions in the documentation. > > Joel It's actually an operator, for inequality of strings. It's the complement of eq, the string equality operator eq. These measure strings for character-by-character equality. This is as dis

Re: Could I put commands in a variable

2004-02-20 Thread R. Joseph Newton
Daniel Staal wrote: > --As of Thursday, February 19, 2004 6:31 PM -0500, Joel is alleged to have > said: > > > Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the > > same really. > > --As for the rest, it is mine. > > Here's a first approximation of a rewrite. ;-) (Major pro

Re: all matches of a regex-continued

2004-02-20 Thread WC -Sx- Jones
Öznur Taştan wrote: My problem was this I have a sets of patterns and a string and I know in which order these patterns are supposed to exists > What I want is to extract all the substrings when the patterns match to the string. Do you want: xHxx yy z t x xxHyy z t as a solution

Re: Could I put commands in a variable

2004-02-20 Thread James Edward Gray II
On Feb 19, 2004, at 5:31 PM, Joel wrote: Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the same really. Joel: I've gone through and suggested some simple changes up through the first major block. You've already been given a good look at how you might rework the entire s

Re: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
- Original Message - From: "WC -Sx- Jones" <[EMAIL PROTECTED]> To: "Öznur Taştan" <[EMAIL PROTECTED]> Cc: "Perl Lists" <[EMAIL PROTECTED]> Sent: Friday, February 20, 2004 6:06 PM Subject: Re: all matches of a regex-continued > Öznur Taştan wrote: > > > > > My problem was this > > I h

Re: all matches of a regex-continued

2004-02-20 Thread WC -Sx- Jones
Öznur Taştan wrote: My problem was this I have a sets of patterns and a string and I know in which order these patterns are supposed to exists What I want is to extract all the substrings when the patterns match to the string. And not rewrite or randomize the results of substring,

Re: all matches of a regex-continued

2004-02-20 Thread WC -Sx- Jones
Öznur Taştan wrote: http://www.perl.com/pub/a/2002/06/04/apo5.html?page=8 $_ = "abracadabra"; @all = m:any /a.*?a/; produces: abra abraca abracada abracadabra aca acada acadabra ada adabra abra Is there a version available that supports this structure? Or are there any creative i

Re: YA Win32::ODBC question: script hangs on 16th table.

2004-02-20 Thread Jenda Krynicky
From: "McMahon, Chris" <[EMAIL PROTECTED]> > Today's project is to get a complete list of column names for each > table in the database, and the value for the first record (row) in > each table. This code does the right thing for 15 tables and then > hangs and quits without an error message on th

Re: Perl command

2004-02-20 Thread Wiggins d Anconia
> Hi, > > I recently started using Perl to write an installation script. > Can anyone tell me how I could get an RPM package installed using Perl? > > In addition, how can the package dependencies be dealt with? > I have tried insalling a package with the command: > > $cmd = `rpm

Re: Could I put commands in a variable

2004-02-20 Thread Rob Dixon
Paresh Jain wrote: > > On Fri, 20 Feb 2004, Joel wrote: > > > > What does "ne" mean? It's not listed in functions in the documentation. > > > > ne stands for "not equal". it is used in string matching Check out perldoc perlop Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Exiting out of eval block...

2004-02-20 Thread Rob Dixon
Ajit P Singh wrote: > > I have a eval block and some if conditions within it and I would like to > exit the eval block. > i.e > > eval{ > my @resp = something; > if ((some condition)){ > $str_output = "do something"; > > I want to exit from hereto Reach Aft

Perl command

2004-02-20 Thread R.I.Clarke C0052175
Hi, I recently started using Perl to write an installation script. Can anyone tell me how I could get an RPM package installed using Perl? In addition, how can the package dependencies be dealt with? I have tried insalling a package with the command:     $cmd = `rpm -ivh telnet-clien

Re: algorithm query

2004-02-20 Thread Rob Dixon
Ashish Kumar wrote: > > Can anybody suggest where can I find some tips on writing an algorithm and its > conventions on the net. That's a very general question. We need to know a little more about what you're intending to do. > Is algorithm design important for perl programming? Algorithm design

Re: Could I put commands in a variable

2004-02-20 Thread Randy W. Sims
On 02/20/04 09:38, James Edward Gray II wrote: On Feb 20, 2004, at 4:25 AM, Randy W. Sims wrote: On 02/19/04 23:21, James Edward Gray II wrote: On Feb 19, 2004, at 9:22 PM, R. Joseph Newton wrote: I don't know, Rob. I would be interested in hearing of any real-world problem that would demand t

RE: YA Win32::ODBC question: script hangs on 16th table.

2004-02-20 Thread McMahon, Chris
> > > Hello... > > I'm leaving aside the NULL issue for the moment... > > Is that wise ? :-) > Well, I think it's about to become immaterial... > Define 'quits'. Does it 'die'? An error? What is the $? value (oh > sorry, > you are in windows). Yah. Too b

Re: Exiting out of eval block...

2004-02-20 Thread Jenda Krynicky
From: "Singh, Ajit p" <[EMAIL PROTECTED]> > I have a eval block and some if conditions within it and I would like > to exit the eval block. i.e perldoc -f return return EXPR return Returns from a subroutine, "eval", or "do FILE" with the value given in EXPR. Evaluation of EX

Re: Could I put commands in a variable

2004-02-20 Thread James Edward Gray II
On Feb 20, 2004, at 4:25 AM, Randy W. Sims wrote: On 02/19/04 23:21, James Edward Gray II wrote: On Feb 19, 2004, at 9:22 PM, R. Joseph Newton wrote: I don't know, Rob. I would be interested in hearing of any real-world problem that would demand this. I believe the text book example is a languag

Re: Could I put commands in a variable

2004-02-20 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Randy W. Sims) writes: >One example of a legitimate use of goto from perlsub: > > Many "AUTOLOAD" routines load in a definition for the > requested subroutine using eval(), then execute that sub- > routine using a special form of goto() that

Re: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
- Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 20, 2004 4:17 PM Subject: Re: all matches of a regex-continued > Öznur tastan wrote: > > > > I am still dealing with the same problem. > > Rob has suggested me a good solution for ma

Re: all matches of a regex-continued

2004-02-20 Thread Rob Dixon
Öznur tastan wrote: > > I am still dealing with the same problem. > Rob has suggested me a good solution for macthing consecutive patterns like > H K D but not more looser ones like for K[ED]{3,5}? L.{3}A > andn my poor perl knowledge doesn't help me to generalize it: / Are you just saying that

Re: algorithm query

2004-02-20 Thread Wiggins d Anconia
> Hi all, > > Can anybody suggest where can I find some tips on writing an algorithm and its conventions on the net. Is algorithm design important for perl programming? > There is Mastering Algorithms in Perl from O'Reilly that (I imagine) you can get through Safari, http://www.oreilly.com/cata

Re: $self

2004-02-20 Thread Wiggins d Anconia
Please bottom post > > No. $self you'll usually see in a lot of Object Oriented applications. When a > subroutine is called using the -> operator ($mw = MainWindow->new, for > example) the first arguement passed to that subroutine is the name of the > package/class. So, $self is usually us

Re: bless

2004-02-20 Thread Rob Dixon
Randy W. Sims wrote: > > On 02/20/04 01:35, Jacob Chapa wrote: > > > what does bless do? > > It depends on how much you know. ;-) > > Basically it takes a reference to a perl type and tags it as an object, > so that in addition to being a reference to a type, it now has special > properties: primar

RE: Digest::MD5

2004-02-20 Thread Bob Showalter
Dave Tibbals wrote: > I am attempting to install the module Digest::MD5 and it fails with > the makefile for the module. The error reported is "*** missing > separator. Stop". Something's wrong with the Makefile. This can happen if tabs get expanded to spaces or if DOS-style line endings are used

Re: Could I put commands in a variable

2004-02-20 Thread Paresh Jain
ne stands for "not equal". it is used in string matching On Fri, 20 Feb 2004, Joel wrote: > Thanks. > > What does "ne" mean? It's not listed in functions in the documentation. > > Joel > - Original Message - > From: "Daniel Staal" <[EMAIL PROTECTED]> > To: "Perl Beginners" <[EMAIL PRO

Re: Could I put commands in a variable

2004-02-20 Thread Joel
Thanks. What does "ne" mean? It's not listed in functions in the documentation. Joel - Original Message - From: "Daniel Staal" <[EMAIL PROTECTED]> To: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Thursday, February 19, 2004 9:54 PM Subject: Re: Could I put commands in a variable > --As o

Re: Could I put commands in a variable

2004-02-20 Thread Daniel Staal
--As of Friday, February 20, 2004 11:25 AM +, Rob Dixon is alleged to have said: I haven't looked at your code, but I don't think a rewrite is in the spirit of helping beginners at Perl. It may occasionally be the best answer, but I suspect you're simply enjoying yourself here ;) --As for the

Re: Exiting out of eval block...

2004-02-20 Thread Randy W. Sims
On 02/20/04 07:12, Singh, Ajit p wrote: Hello Friens, I have a eval block and some if conditions within it and I would like to exit the eval block. i.e You can use die or goto: #!/usr/bin/perl use strict; use warnings; eval { if (0) { print 'false' } if (1) { goto end_eval } }; print "before

Re: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
- Original Message - From: "Randy W. Sims" <[EMAIL PROTECTED]> To: "Öznur Taştan" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, February 20, 2004 2:11 PM Subject: Re: all matches of a regex-continued > On 02/20/04 07:03, Öznur Taştan wrote: > > I didn't know something exists

Exiting out of eval block...

2004-02-20 Thread Singh, Ajit p
Hello Friens, I have a eval block and some if conditions within it and I would like to exit the eval block. i.e eval{ my @resp = something; if ((some condition)){ $str_output = "do something"; > I want to exit from hereto Reach After Eval

Re: all matches of a regex-continued

2004-02-20 Thread Randy W. Sims
On 02/20/04 07:03, Öznur Taştan wrote: I didn't know something exists like this, thanks that will be very helpful but still does this solve the problem of regular expression patterns istead of keys just as I mentioned in the first mail. " I am still dealing with the same problem. Rob has suggested

algorithm query

2004-02-20 Thread Ashish Kumar
Hi all, Can anybody suggest where can I find some tips on writing an algorithm and its conventions on the net. Is algorithm design important for perl programming? thanks. ashish. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Fw: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
- Original Message - From: "Öznur Taştan" <[EMAIL PROTECTED]> To: "Randy W. Sims" <[EMAIL PROTECTED]> Sent: Friday, February 20, 2004 2:03 PM Subject: Re: all matches of a regex-continued > > - Original Message - > From: "Randy W. Sims" <[EMAIL PROTECTED]> > To: "Öznur Taştan" <[

Re: all matches of a regex-continued

2004-02-20 Thread Randy W. Sims
On 02/20/04 06:06, Öznur Taştan wrote: You are right but the sets of patterns can include any number of patterns which will mean a variable number of foreach loop and I don't know how to achieve. thanks oznur Ok, welcome to the wonderful world of dynamic code generation. The code below is ugly as

Re: Could I put commands in a variable

2004-02-20 Thread Rob Dixon
Daniel Staal wrote: > > --As of Thursday, February 19, 2004 6:31 PM -0500, Joel is alleged to have > said: > > > Here it is. Okay so it isn't tommorow. I shortened it a bit, but its the > > same really. > > --As for the rest, it is mine. > > Here's a first approximation of a rewrite. ;-) (Major pr

Re: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
- Original Message - From: "David le Blanc" <[EMAIL PROTECTED]> To: "Öznur Taştan" <[EMAIL PROTECTED]>; "Perl Lists" <[EMAIL PROTECTED]> Sent: Friday, February 20, 2004 1:35 PM Subject: RE: all matches of a regex-continued > > > > In the below link I came across > > > > http://www.perl.c

RE: all matches of a regex-continued

2004-02-20 Thread David le Blanc
> > In the below link I came across > > http://www.perl.com/pub/a/2002/06/04/apo5.html?page=8 > > $_ = "abracadabra"; > @all = m:any /a.*?a/; > produces: > What version of perl are we talking about here? 5.8 or 6 maybe? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
You are right but the sets of patterns can include any number of patterns which will mean a variable number of foreach loop and I don't know how to achieve. thanks oznur > On 02/20/04 04:31, Öznur Taştan wrote: > > You are rigth to confuse beacuse I couldn't find the mail I wrote at the > > beg

Re: Could I put commands in a variable

2004-02-20 Thread Randy W. Sims
On 02/19/04 14:22, Joel wrote: Yes, BASIC is the only programming I have ever done. All I can really remember was PRINT, GOTO, and a variety of line numbers. I'm trying to write a text adventure You might "steal" some code from the module Games::Rezrov .

Re: Could I put commands in a variable

2004-02-20 Thread Randy W. Sims
On 02/19/04 23:21, James Edward Gray II wrote: On Feb 19, 2004, at 9:22 PM, R. Joseph Newton wrote: I don't know, Rob. I would be interested in hearing of any real-world problem that would demand this. I believe the text book example is a language that lacks support for something like Java's

Re: all matches of a regex-continued

2004-02-20 Thread Randy W. Sims
On 02/20/04 04:31, Öznur Taştan wrote: You are rigth to confuse beacuse I couldn't find the mail I wrote at the beginning that defines the problem.Sorry.. My problem was this I have a sets of patterns and a string and I know in which order these patterns are supposed to exists What I try to do was

RE: Could I put commands in a variable

2004-02-20 Thread David le Blanc
> > > > If I was using one specific group of commands, Could I put > them inside a > > variable, then just use the variable when I needed the > commands instead of > > copying and pasting them? > > > > i.e. > > print "Hello world"; > > if ($i == 50) { > > goto MAIN; > > } > > elsif ($t ==

RE: Could I put commands in a variable

2004-02-20 Thread David le Blanc
If you want a fantastic text adventure. try reading the perl source code. [what was that noise Jim?] > -Original Message- > From: Joel [mailto:[EMAIL PROTECTED] > Sent: Friday, 20 February 2004 6:45 AM > To: perl > Subject: Re: Could I put commands in a variable > > I'll post th

Re: all matches of a regex-continued

2004-02-20 Thread Öznur Taştan
You are rigth to confuse beacuse I couldn't find the mail I wrote at the beginning that defines the problem.Sorry.. My problem was this I have a sets of patterns and a string and I know in which order these patterns are supposed to exists What I try to do was to extract the substrings when the patt

Re: bless

2004-02-20 Thread Randy W. Sims
and here is the code I was using to test with which is pretty much as shown in the previous message with a little formatting of the output. #!/usr/bin/perl use strict; use warnings; use constant HR => "\n\n" . '-'x60 . "\n\n"; print HR; my %ahash; my $href = \%ahash; $href->{key} = 'value'; pr

Re: all matches of a regex-continued

2004-02-20 Thread WC -Sx- Jones
Öznur Taştan wrote: In the below link I came across http://www.perl.com/pub/a/2002/06/04/apo5.html?page=8 $_ = "abracadabra"; @all = m:any /a.*?a/; produces: abra abraca abracada abracadabra aca acada acadabra ada adabra abra That only shows substrings within string that begin

Re: capture a website and process its data

2004-02-20 Thread WC -Sx- Jones
David le Blanc wrote: Spot on Rob. How about perl.re.beginners?? I learn a new way to use RE's every day! OK, perl -w -Mre=debug -e 'use warnings' Or, maybe perl -w -Mre=debug -e '"this is a test" =~ m/[this is a test]/;' Hint: [] is a character class. -Sx- bash-2.05$ perl -v | grep built

Re: bless

2004-02-20 Thread Randy W. Sims
On 02/20/04 01:35, Jacob Chapa wrote: what does bless do? It depends on how much you know. ;-) Basically it takes a reference to a perl type and tags it as an object, so that in addition to being a reference to a type, it now has special properties: primarily that it can have subroutines (metho

  1   2   >