Re: finding needle in a haystack

2005-06-22 Thread Ing. Branislav Gerzo
Bret Goodfellow [BG], on Wednesday, June 22, 2005 at 15:55 (-0600) wrote these comments: >This is what I actually did to resolve my issue: >@words = split(/ * /, $line) >Print "the third word is: $words[2]\n"; this is not good, you don't know about regexpes much, eh? first argument in split is //

Re: finding needle in a haystack

2005-06-22 Thread Ing. Branislav Gerzo
Chris Devers [CD], on Wednesday, June 22, 2005 at 17:53 (-0400 (EDT)) wrote the following: CD> my $fields = split( /\s+/, $record ); CD> my $fourth = $fields[3]; CD> This problem doesn't require any looping! :-) I, know, thats just example. I read whole the message, in original was: "I want

Re: Critcize my scripts.

2005-06-22 Thread John W. Krahn
loan tran wrote: Please critize my scripts and suggest better ways to accomplish the same task. (I know it's a good practice to put use strict in Perl script but I'm struggling to make my scripts work with use strict.The script below work fine if I comment out use strict.) They look more lik

Re: how to append blocks in same file

2005-06-22 Thread John W. Krahn
Aditi Gupta wrote: Hi Perlers, Hello, I have a file as follows: #block1 aaa aaa #block2 bbb bbb #block3 ccc ccc and i want to append(or i should say merge) these blocks and get a file like this: aaabbbccc aaabbbccc how can this be done using perl? please help.. $ echo " aaa aaa bb

Re: How to handle Null-Charakters

2005-06-22 Thread John W. Krahn
Angerstein wrote: Hello, Hello, I have a problem reading strings out of a binaery file. perldoc -f binmode The last 128 Byte of the File contains a String I want to work with. (sorry, this code is windows, feel free to flame me ^^) my $tsize = 128; my $

Re: how to add additional paths in $INC( can't locate SF:Logger.pm in $INC)

2005-06-22 Thread Wiggins d'Anconia
MEENA SELVAM wrote: > My perl program snas.pl uses SF:Logger.pm which is > available in /usr/local/sf/lib/perl/5.8.3/SF. I have > added this directory in the path (.cshrc and .tshrc). > I am running as root, and I get the cant locate > SF::Logger.pm error in $INC. > > $INC contains usr/lib/perl5/5

how to add additional paths in $INC( can't locate SF:Logger.pm in $INC)

2005-06-22 Thread MEENA SELVAM
My perl program snas.pl uses SF:Logger.pm which is available in /usr/local/sf/lib/perl/5.8.3/SF. I have added this directory in the path (.cshrc and .tshrc). I am running as root, and I get the cant locate SF::Logger.pm error in $INC. $INC contains usr/lib/perl5/5.6.1/i386_linux and some more usr/

cant locate SF:Logger.pm in @INC: how to add additional paths in @INCHi,

2005-06-22 Thread MEENA SELVAM
__ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Critcize my scripts.

2005-06-22 Thread Wiggins d'Anconia
loan tran wrote: > Please critize my scripts and suggest better ways to > accomplish the same task. > You asked for it. > (I know it's a good practice to put use strict in Perl > script but I'm struggling to make my scripts work with > use strict.The script below work fine if I comment out > use

Re: how to append blocks in same file

2005-06-22 Thread Wijaya Edward
> and i want to append(or i should say merge) these blocks and get a > file like this: > aaabbbccc > aaabbbccc I've asked the same question some time ago, check this out: http://groups-beta.google.com/group/perl.beginners/browse_thread/thread/4f28012f744d10e0/7638b6eb94a626d2?q=edward+wijaya+g

anyone knows how to get rid of this error while building CPAN module XML:Smart

2005-06-22 Thread MEENA SELVAM
Hi, I downloaded, the CPAN module XML:Smart, and used perl Makefile.PL make make test in order to build the module (as specified in man perlmodinstall)and install it in my perl repository. I am getting the following error: ok 115 ok 116 ok 117 ok 118 ok 119 ok 120 ok 121 ok 122 ok 123 ok 124 ok 1

Critcize my scripts.

2005-06-22 Thread loan tran
Please critize my scripts and suggest better ways to accomplish the same task. (I know it's a good practice to put use strict in Perl script but I'm struggling to make my scripts work with use strict.The script below work fine if I comment out use strict.) [EMAIL PROTECTED] /home/sybase/scripts/

RE: finding needle in a haystack

2005-06-22 Thread Bret Goodfellow
-Original Message- From: Chris Devers [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 3:17 PM To: Bret Goodfellow Cc: Perl Beginners List Subject: Re: finding needle in a haystack On Wed, 22 Jun 2005, Bret Goodfellow wrote: > All right, I know how to do this in REXX because t

Re: finding needle in a haystack

2005-06-22 Thread Chris Devers
On Wed, 22 Jun 2005, Ing. Branislav Gerzo wrote: > Bret Goodfellow [BG], on Wednesday, June 22, 2005 at 15:11 (-0600) > typed the following: > > BG> All right, I know how to do this in REXX because there is a word() > BG> function, but how do I do this in Perl. I want to read in one record at >

Re: finding needle in a haystack

2005-06-22 Thread Ing. Branislav Gerzo
Bret Goodfellow [BG], on Wednesday, June 22, 2005 at 15:11 (-0600) typed the following: BG> All right, I know how to do this in REXX because there is a word() BG> function, but how do I do this in Perl. I want to read in one record at BG> a time, that has space-delimited fields. There may be mul

Re: finding needle in a haystack

2005-06-22 Thread Chris Devers
On Wed, 22 Jun 2005, Bret Goodfellow wrote: > All right, I know how to do this in REXX because there is a word() > function, but how do I do this in Perl. The split() function is what you're looking for. $ perldoc -f split The perldoc gives this example: A pattern matching the null st

finding needle in a haystack

2005-06-22 Thread Bret Goodfellow
All right, I know how to do this in REXX because there is a word() function, but how do I do this in Perl. I want to read in one record at a time, that has space-delimited fields. There may be multiple spaces between the words. I want to be able to get for example, the 4th word of the record. H

Re: how to append blocks in same file

2005-06-22 Thread Dave Gray
On 6/22/05, Dan Klose <[EMAIL PROTECTED]> wrote: > > > Using a hash of arrays will not necessarily preserve the order... > > If you don't want to worry about sorting the order of the blocks i.e. > doing it yourself then use Tie::IXhash (something like that on CPAN) to > preserve the order, you th

Re: how to append blocks in same file

2005-06-22 Thread Dan Klose
> Using a hash of arrays will not necessarily preserve the order... If you don't want to worry about sorting the order of the blocks i.e. doing it yourself then use Tie::IXhash (something like that on CPAN) to preserve the order, you then don't have to worry about unbalanced blocks and reassembly

Re: Syncsave Integers 7Bit Data +1 sync bit... How do I get my value out of it?

2005-06-22 Thread Dave Gray
On 6/22/05, Angerstein <[EMAIL PROTECTED]> wrote: > The mp3 format uses something (sick) called syncsave integer. > > If you have a 4 Byte 32 Bit the very first bit of every Byte is used > as a syncsave bit. so you can only put a 28 Bit long Number in it. > > Puting stuff in this format is the on

Re: Regex Multi-Line Matching

2005-06-22 Thread Jeff Westman
Hey Chris, I'm not spamming anyone. I had an error when I sent my email(s) so I resent it. Sorry you had to click the mouse an additional time to 'delete'. Jeff On 6/20/05, Chris Devers <[EMAIL PROTECTED]> wrote: > On Mon, 20 Jun 2005, Jeff Westman wrote: > > > Any help would be greatl

Re: how to append blocks in same file

2005-06-22 Thread Dave Gray
On 6/22/05, Aditi Gupta <[EMAIL PROTECTED]> wrote: > Since i'm using activestate perl on windows xp i don't know whether paste > will work or not. > I'll try the hash of array. Using a hash of arrays will not necessarily preserve the order. Below is the start of an array of arrays solution. I'll l

Re: cgi link

2005-06-22 Thread Graeme St.Clair
Try something like:- $html .= start_html( -title => "Rhubarb", -style => { 'src' => '../rhubarb.css' }, -script => [ { 'src' => '../rhubarb.js' }, $jscript ] ); HTH, GStC. - Origin

Re: ssh to a remote machine

2005-06-22 Thread [EMAIL PROTECTED]
Did you even bother to search CPAN? http://search.cpan.org/~ivan/Net-SSH-0.08/SSH.pm Or atleast google in the very least? http://www.google.com/search?ie=UTF-8&oe=UTF-8&q=perl+ssh+library - Original Message: From: Vijay Kumar Adhikari <[EMAIL PROTECTED]> To: beginners@perl

RE: How to handle null-chars

2005-06-22 Thread Charles K. Clarkson
Angerstein wrote: : @id3v1 contain 128 Byte Bincode. : to fix 0 Chars I do: : ### : $label = &cleanup(0,3); : : sub cleanup { : my $jn; : $start = shift; : $stop = shift; : $jn = join("", @id3v1[$start..$stop]); : $jn =~ s/\0//; : r

Re: how to append blocks in same file

2005-06-22 Thread Aditi Gupta
HI Dan, Since i'm using activestate perl on windows xp i don't know whether paste will work or not. I'll try the hash of array. Thanks for the help regards Aditi. On 6/22/05, Dan Klose <[EMAIL PROTECTED]> wrote: > > If I was doing this I would split the file on the gaps between blocks > and

Re: how to append blocks in same file

2005-06-22 Thread Aditi Gupta
Hi all, I know the terms of the list.. and before this i have always written a code and asked for a doubt if it doesn't work... but this time i'm not aware of any way to do the job.. thats why i asked to help me out, I haven't asked for any code, just hints what can be used. I'm sorry if i gave

Re: creating html interface for the perl code

2005-06-22 Thread Wiggins d'Anconia
Aditi Gupta wrote: > Hi everybody, > > I've to create html inteface for a perl code. I've to get the input from the > user and the data entered in the form has to be processed and output(which > is a graph) has to be displayed to the user. But i don't know how to do > it... I am adviced to go f

RE: how to append blocks in same file

2005-06-22 Thread Dan Klose
If I was doing this I would split the file on the gaps between blocks and the use the unix paste function to assemble the blocks. &> paste A B C > D ? using a hash of arrays (HOA) to store each block and then go back over the HOA each element at a time ... although this is probably overkill? On

Syncsave Integers 7Bit Data +1 sync bit... How do I get my value out of it?

2005-06-22 Thread Angerstein
Hello, I have just another issue fighting binaeries. The mp3 format uses something (sick) called syncsave integer. If you have a 4 Byte 32 Bit the very first bit of every Byte is used as a syncsave bit. so you can only put a 28 Bit long Number in it. Puting stuff in this format is the one thing

Re: creating html interface for the perl code

2005-06-22 Thread Dave Gray
On 6/22/05, Aditi Gupta <[EMAIL PROTECTED]> wrote: > I've to create html inteface for a perl code. I've to get the input from the > user and the data entered in the form has to be processed and output(which > is a graph) has to be displayed to the user. But i don't know how to do > it... I am advic

Re: cgi link

2005-06-22 Thread Chris Devers
On Wed, 22 Jun 2005, Brent Clark wrote: > [I'm] trying to get a line as such: > You're already using CGI.pm, so why not let it do this for you? Modifying the code there a bit, this could work: $newStyle

RE: how to append blocks in same file

2005-06-22 Thread Larsen, Errin M HMMA/IT
Aditi Gupta wrote: > Hi Perlers, > > I have a file as follows: > > #block1 > aaa > aaa > > #block2 > bbb > bbb > > #block3 > ccc > ccc > > and i want to append(or i should say merge) these blocks and get a > file like this: > > aaabbbccc > aaabbbccc > > how can this be done using perl? > ple

Re: How to handle Null-Charakters

2005-06-22 Thread Dave Gray
On 6/22/05, Angerstein <[EMAIL PROTECTED]> wrote: > I have a problem reading strings out of a binaery file. > > The last 128 Byte of the File contains a String I want to work with. > > (sorry, this code is windows, feel free to flame me ^^) > > my $tsize = 128; >

cgi link

2005-06-22 Thread Brent Clark
Hi all keep getting this message below. Undefined subroutine &main::Link called at C:/Program Files/Apache Group/Apache2/cgi-bin/ecco/scripts/common/getXmlAgents.pl line 24. Here is my code print $html->header(), $html->start_html('Get REMOTE BOOKINGS', -head=>Link({-rel=>'STYLESHE

how to append blocks in same file

2005-06-22 Thread Aditi Gupta
Hi Perlers, I have a file as follows: #block1 aaa aaa #block2 bbb bbb #block3 ccc ccc and i want to append(or i should say merge) these blocks and get a file like this: aaabbbccc aaabbbccc how can this be done using perl? please help.. regards Aditi

Re: ssh to a remote machine

2005-06-22 Thread D. J. Birkett
Vijay Kumar Adhikari wrote: Hi, I need to ssh to a remote machine, run a command and get the output. Is there some modules that can help. TIA Vijay You could start here... http://search.cpan.org/search?query=ssh&mode=all -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: ssh to a remote machine

2005-06-22 Thread MNibble
Vijay Kumar Adhikari wrote: Hi, I need to ssh to a remote machine, run a command and get the output. Is there some modules that can help. TIA Vijay Yes there is .. Net::SSH::Perl If you ask google "Perl Ssh Perl" you will get the same answer. Or you can do something like: my $output = `ssh

Re: \n & ^M

2005-06-22 Thread Xavier Noria
On Jun 22, 2005, at 11:07, Dan Klose wrote: Hi everybody, I have exported an EndNote 7 Library on my Mac to a Bibtex formatted plain text file. When I look at the file, rather than having lines ending with '\n' I seem to have '^M'. I think this is a Mac end of line problem but the things I

\n & ^M

2005-06-22 Thread Dan Klose
Hi everybody, I have exported an EndNote 7 Library on my Mac to a Bibtex formatted plain text file. When I look at the file, rather than having lines ending with '\n' I seem to have '^M'. I think this is a Mac end of line problem but the things I have tried don't work and I was wondering if anyon

Re: How to handle null-chars

2005-06-22 Thread Angerstein
@id3v1 contain 128 Byte Bincode. to fix 0 Chars I do: ### $label = &cleanup(0,3); sub cleanup { my $jn; $start = shift; $stop = shift; $jn = join("", @id3v1[$start..$stop]); $jn =~ s/\0//; return $jn; } ### Anybody with somethi

ssh to a remote machine

2005-06-22 Thread Vijay Kumar Adhikari
Hi, I need to ssh to a remote machine, run a command and get the output. Is there some modules that can help. TIA Vijay -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.323 / Virus Database: 267.7.10/25 - Release Date: 6/21/2005 -- To unsubscribe, e-mail

How to handle Null-Charakters

2005-06-22 Thread Angerstein
Hello, I have a problem reading strings out of a binaery file. The last 128 Byte of the File contains a String I want to work with. (sorry, this code is windows, feel free to flame me ^^) my $tsize = 128; my $fsize = (-s "d:\\mp3\\forseti.mp3"); my $offset = ($f

creating html interface for the perl code

2005-06-22 Thread Aditi Gupta
Hi everybody, I've to create html inteface for a perl code. I've to get the input from the user and the data entered in the form has to be processed and output(which is a graph) has to be displayed to the user. But i don't know how to do it... I am adviced to go for CGI, and i only know basic h