Re: Regular Expressions - multiplelines

2004-07-26 Thread Damon Allen Davison
Hi Roman, Roman wrote: > use strict; > > my $file = shift; > my $line; > > > open(IN, "<$file") || die "$!"; > while($line =) > { >$line =~ /(\$\S+):.(\S+)/is; > >print "match1: $1; match2: $2 \n"; > } I would redefine the record separator for your while loop to process each of the four re

WTH is Perlmonth?

2004-07-26 Thread Jorge Almeida
I tried to access http://www.perlmonth.com/columns/perl_xml/perl_xml.html?issue=6&id=942847824 looking for a tutorial "The DOMinant Technique for Parsing XML" I saw the link in http://www-106.ibm.com/developerworks/linux/library/xml-perl2/ I also tried http://www.perlmonth.com/ I d

a sed equivelent

2004-07-26 Thread Jerry M. Howell II
hello all, I'm just beginning to work with sed in shell scripts I was wondering if anyone has a simmilar script in perl they can send my way or what the perl equivelent of the sed /s would be. Here is the coresponding shell script if it'll help you understand what I'm trying to acomplish. #!/b

A RegEx question

2004-07-26 Thread Ian Marlier
Hi, all -- I'm in the process of writing a script to migrate from one wiki package to another. The old wiki help articles in a series of flat text files. The new one holds everything in MySQL, so I need to parse the text files into a single SQL import script. I've got most of it, but there's on

Re: A RegEx question

2004-07-26 Thread JupiterHost.Net
Ian Marlier wrote: Hi, all -- Howdy, I'm in the process of writing a script to migrate from one wiki package to another. The old wiki help articles in a series of flat text files. The new one holds everything in MySQL, so I need to parse the text files into a single SQL import script. I've got m

RE: a sed equivelent

2004-07-26 Thread Bob Showalter
Jerry M. Howell II wrote: > hello all, > >I'm just beginning to work with sed in shell scripts I was > wondering if anyone has a simmilar script in perl they can send my > way or what the perl equivelent of the sed /s would be. Here is the > coresponding shell script if it'll help you understa

reading log files in real time

2004-07-26 Thread Adrian Farrell
Hi, I'm looking for a way to read log files in real time, so that each time a new entry appears in the file I can perform a search/query (whatever really!) on it. it's odd really, as I expected this to be a very common scenario and yet I can find nothing on it! I think there maybe some way to ac

Re: A RegEx question

2004-07-26 Thread Ian Marlier
> Ian Marlier wrote: >> Hi, all -- > > Howdy, > >> I'm in the process of writing a script to migrate from one wiki package to >> another. >> >> The old wiki help articles in a series of flat text files. The new one >> holds everything in MySQL, so I need to parse the text files into a single >>

Re: A RegEx question

2004-07-26 Thread Gunnar Hjalmarsson
Ian Marlier wrote: I'm in the process of writing a script to migrate from one wiki package to another. The old wiki help articles in a series of flat text files. The new one holds everything in MySQL, so I need to parse the text files into a single SQL import script. I've got most of it, but the

Re: WTH is Perlmonth?

2004-07-26 Thread Jenda Krynicky
From: Jorge Almeida <[EMAIL PROTECTED]> > I tried to access > http://www.perlmonth.com/columns/perl_xml/perl_xml.html?issue=6&id=9 > 42847824 > looking for a tutorial "The DOMinant Technique for Parsing XML" > I saw the link in > http://www-106.ibm.com/developerworks/linux/library/xml-perl2/

Re: a sed equivelent

2004-07-26 Thread Ramprasad A Padmanabhan
This should do your work, as long as your strings dont have any special chars. perl -pli.BAK -e 's/OLDSTRING/NEWSTRING/g' FILENAME (You can also use it for multiple files and will create a .BAK file incase you want to revert ) HTH Ram On Mon, 2004-07-26 at 17:21, Jerry M. Howell II wrote: > he

Re: reading log files in real time

2004-07-26 Thread Ramprasad A Padmanabhan
use File::Tail; Ram On Mon, 2004-07-26 at 18:19, Adrian Farrell wrote: > Hi, > > I'm looking for a way to read log files in real time, so that each time a > new entry appears in the file I can perform a search/query (whatever > really!) on it. > > it's odd really, as I expected this to be a ver

Re: Multiple Parameters

2004-07-26 Thread James Edward Gray II
(Let's keep our discussion on the list so all can help and learn.) On Jul 25, 2004, at 8:09 PM, <[EMAIL PROTECTED]> wrote: OK i still can't figure this out, i understand what you explained but i still can't figure out why it doesn't want to write to the new file and also why it only removes the co

Re: WTH is Perlmonth?

2004-07-26 Thread Jorge Almeida
On Mon, 26 Jul 2004, Jenda Krynicky wrote: I think it simply died and these worms are feasting on the dead flesh :-( A pox on all of them... At least they do not try to install their silly useless page as my browser's homepage like most of these guys do. Is that possible at all?! Spooky... Cheers,

Search and Replace

2004-07-26 Thread Mallik
Dear Friends, I have the below string. $str = "iabd a bdkf a kdfkj akdfakjkf"; I want to replace all the 'a' s prceeded and followed by spaces with 'A'. The output should be like this $str = "iabd Abdkf A kdfkj akdfakjkf"; Any easy reg exp? Regards, Mallik. -- To unsubscribe, e-mai

RE: Search and Replace

2004-07-26 Thread Charles K. Clarkson
Mallik <[EMAIL PROTECTED]> wrote: : I have the below string. : : $str = "iabd a bdkf a kdfkj akdfakjkf"; : : I want to replace all the 'a' s prceeded and : followed by spaces with 'A'. : : The output should be like this : : $str = "iabd Abdkf A kdfkj akdfakjkf"; : : Any easy reg exp?

Filesystem Link Scanner

2004-07-26 Thread perl.org
I want to get a list of the distinct domains (like perl.org) in all href attribute values of anchor tags in all files under a given directory that end with the extensions .htm and .html. I don't need to know which files contain the links, I just want to know what domains are referenced. I don't c

perl.beginners Weekly list FAQ posting

2004-07-26 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Re: Regular Expressions - multiplelines

2004-07-26 Thread John W. Krahn
Roman Hanousek wrote: Hi Hello, I have a txt file that contains the following info: Text start here $/Dev/something/something.com/blah1: default.asp userExc 26/07/04 1:42p [TEST-DEV]F:\content\blah\wwwroot\blah1 $/Dev/something/something.com/som

Having trouble using the Shell within Perl script.

2004-07-26 Thread jason corbett
Hello. I would like to use the shell to run SQL scripts or PL/SQL scripts written by co-workers. These scripts are useful and I don't need to do re-work so I am trying to use them in my perl script where i can retrieve the data that results from running them into a $scalar, @array, or %hash. I c

Re: Filesystem Link Scanner

2004-07-26 Thread perl.org
On Mon, 26 Jul 2004 11:27:50 -0400, perl.org wrote > I want to get a list of the distinct domains (like perl.org) in all href > attribute values of anchor tags in all files under a given directory > that end with the extensions .htm and .html. I don't need to know > which files contain the links

Re: Having trouble using the Shell within Perl script.

2004-07-26 Thread Eric Walker
Does the output from the scripts go into a file or does the output print to the screen(standard out)? If it goes to a file then you need to open the file and read the info. If it goes to standard out you can do something like this to get the ouput. @info=`/home/my/directory/` (the backtick not t

Re: Serious question on using Perl or not...

2004-07-26 Thread Wiggins d Anconia
> > Hi! > > I do not know I am on the right mailing list. > If not, sorry for the burden. > The advocacy list is not the appropriate list, so I have bcc'd it so it gets dropped from the discussion. Your question is better asked to the [EMAIL PROTECTED] list, I have copied it so that it is in the

(U) RE: (repost) how can i generate 10 unique (non repeating) num bers

2004-07-26 Thread Johnson, Michael
CLASSIFICATION: UNCLASSIFIED just add a little more logic to determine if the new number has already been selected. This will require storing to a list and then checking that list each time a new number is generated. -Original Message- From: Flemming Greve Skovengaard [mailto:[EMAIL PRO

Re: Serious question on using Perl or not...

2004-07-26 Thread u235sentinel
Several ways come to mind including hashs or possibly an array. If it doesn't have to stay in memory (I know he said memory.. just exploring options), it's always possible to setup maybe a DBM hash and write/pull off of that (Yes I know it was already mentioned... I'm agreeing with Wiggins basi

Changing the return value of a built in function

2004-07-26 Thread jason corbett
Hello all. I am running into a problem with a proprietary job scheduler that mimicks the Cron on a Unix box (with more bells and whistles that a cow farm, but with the same amout of BS). I ran a script using DBI->trace(2, 'dbitrace.log'); and noticed that the $sth->execute( ); function is

RE: Multiple Parameters

2004-07-26 Thread mafioso1823
Thank you very much for your help, but i have one more question, is this the way that regex works or is it something in my code, every time i try to run the script to search for a comma and replace it with a new line character (\n) it just removes the commas but doesn't replace it with a new line c

RE: keeping the file name while checking w/ LWP

2004-07-26 Thread Brian Volk
Gunnar Hjalmarsson wrote: >Use map() together with split() to populate a hash. Like this... my %urls = map { split(' ', $_) } ; if this is correct, can someone hint to me how I am supposed to incorporate this into my foreach statement. use strict; use LWP::Simple; my $file = "/Program Files

Re: Serious question on using Perl or not...

2004-07-26 Thread Chris Devers
On Mon, 26 Jul 2004, Wiggins d Anconia wrote: On Mon, 26 Jul 2004, Gregoire Hostettler wrote: I already spent more than 20 hours for something which should take 30 minutes [] Looks like Perl is not able to handle trivial data structure like an array of records (or hashes). Sure it can, and

Re: [SOLUTION] how can i generate 10 unique (non repeating) numbers

2004-07-26 Thread Zeus Odin
If you want to do it without the use of a module, you could (1) add the 15 numbers to an array (the deck) (2) choose a random number from the deck (3) remove that random element and add it to another array (your hand) (4) repeat until done (your hand has 10 numbers) This sounds exactly like the s

Re: keeping the file name while checking w/ LWP

2004-07-26 Thread Gunnar Hjalmarsson
Brian Volk wrote: Gunnar Hjalmarsson wrote: Brian Volk wrote: I have a file that contains the file name and the url. I need to separate the url so I can use LWP::Simple; to check the link, however, I need to keep the file name in tact so I can trace it back to my website. Anyone have any suggesti

Re: Multiple Parameters

2004-07-26 Thread James Edward Gray II
On Jul 26, 2004, at 6:29 PM, <[EMAIL PROTECTED]> wrote: Thank you very much for your help, but i have one more question, is this the way that regex works or is it something in my code, every time i try to run the script to search for a comma and replace it with a new line character (\n) it just

Regex to do ///?

2004-07-26 Thread Ian Marlier
Hi, all -- I've got another RegEx question, a follow-up to one that I asked earlier today: Given a string that looks like this: "This is a (string of words) that go together" I need to turn it into this: "This is a (stringofwords) that go together" Which is to say, I need to match one set of ch

Re: Regex to do ///?

2004-07-26 Thread James Edward Gray II
On Jul 26, 2004, at 8:17 PM, Ian Marlier wrote: Hi, all -- I've got another RegEx question, a follow-up to one that I asked earlier today: Given a string that looks like this: "This is a (string of words) that go together" I need to turn it into this: "This is a (stringofwords) that go together"

Re: Regex to do ///?

2004-07-26 Thread Gunnar Hjalmarsson
Ian Marlier wrote: Given a string that looks like this: "This is a (string of words) that go together" I need to turn it into this: "This is a (stringofwords) that go together" Which is to say, I need to match one set of characters (the parentheses) and then do a reg-ex operation on another (the sp