New Line / Chomp Query

2004-07-22 Thread David Clarke
Hi, does anyone know what the new line character value is in Hex for a text file ? Is it "0d 0a" ? I'm trying to read in a line of text, chomp it, attach 3 digits at the end of this line, then write this line to output file. But when I write it out, the original input line is written out, the

Re: Dot not string cat?

2004-07-22 Thread Bryan Harris
>> Does anyone know why this doesn't do what I expect? >> >> % perl -e '$i="123.52.32.1"; $j=45; $b="$i_".$j*2; print $b, "\n";' >> 90 > > perl does. Try turning on warnings. > >> I'd like it to print: 123.52.32.1_90 >> >> What's going on here? > > You need something like > > $b="${i}_".

Interesting issue: $t->print("ls"); fails.

2004-07-22 Thread Marco Perl
I'm always grateful for your input. I have 2 functions, in func1 any $t->print(); works fine. but func1 got too long and I created func2 to continue on $t->print(); statements but it doesn't work because perl interpreter does not know what $t is. so!, how can I associate $t in func2 to $t in func

Re: sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread JupiterHost.Net
Jeff 'japhy' Pinyan wrote: On Jul 22, JupiterHost.Net said: my %data = ( 'foo' => { sorton => 2, data => 'blah' }, 'bar' => { sorton => 1, data => 'yike' }, 'baz' => { sorton => 3, data => 'zipp' }, ); I'd like to sort them on the sorton key so it is: sort { $data{$a}{sorton} <=> $data{$

Re: sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread JupiterHost.Net
JupiterHost.Net wrote: Hello, Long week and brain is off :) I have a hash like so: my %data = ( 'foo' => { sorton => 2, data => 'blah' }, 'bar' => { sorton => 1, data => 'yike' }, 'baz' => { sorton => 3, data => 'zipp' }, ); for(sort %data) { print ${ $data{$_} }{data},"\n"; } Ok, I thi

Re: sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread Jeff 'japhy' Pinyan
On Jul 22, JupiterHost.Net said: >my %data = ( >'foo' => { sorton => 2, data => 'blah' }, >'bar' => { sorton => 1, data => 'yike' }, >'baz' => { sorton => 3, data => 'zipp' }, >); > >I'd like to sort them on the sorton key so it is: sort { $data{$a}{sorton} <=> $data{$b}{sorton} } k

sort() on specific key in each hashref of a hash of hashrefs

2004-07-22 Thread JupiterHost.Net
Hello, Long week and brain is off :) I have a hash like so: my %data = ( 'foo' => { sorton => 2, data => 'blah' }, 'bar' => { sorton => 1, data => 'yike' }, 'baz' => { sorton => 3, data => 'zipp' }, ); for(sort %data) { print ${ $data{$_} }{data},"\n"; } output: yike zipp blah I'd like t

RE: Install modules locally

2004-07-22 Thread Hanson, Rob
I don't recall that thread, but basically you can do a few things. When you install, specify some local directory to install into: perl Makefile.PL PREFIX=/some/local/path LIB=/some/local/path "/some/local/path" is the root of your local library. For some modules that don't require pre-process

RE: splitting large xml file

2004-07-22 Thread Hanson, Rob
> Ideally, I would use SAX to parse things Optionally you could look at XML::RAX. Article on the RAX concept: http://www.xml.com/pub/a/2000/04/26/rax/index.html RAX allows you to specify a record seperator (a tag in the XML file), and splits into into chunks of that tag. It is stream based so i

Suppressing Carp

2004-07-22 Thread Papo Napolitano
Hi! Is there any way of suppressing warnings/errors thrown by Carp other than redirecting STDERR to /dev/null? TIA.- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Install modules locally

2004-07-22 Thread Mike Blezien
Hello, I seemed to recall an earlier posting regarding instruction on how to install Perl modules locally when one doesn't have root access, but was able to find the thread. Can someone possible post that info again. Much appreciated :) -- MikeBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thun

splitting large xml file

2004-07-22 Thread Sean Davis
I have a very large (200Mb) XML file that consists of multiple records. I would like to split these records up and store the XML for each in a database for quick retrieval. I simply need to echo all of the XML between the enclosing record tags into the database. Ideally, I would use SAX to parse

tracking where I am in a tree structure (was: Re: parsing HTML)

2004-07-22 Thread Andrew Gaffney
Andrew Gaffney wrote: Andrew Gaffney wrote: Randy W. Sims wrote: On 7/21/2004 11:24 PM, Andrew Gaffney wrote: Randy W. Sims wrote: On 7/21/2004 10:42 PM, Andrew Gaffney wrote: I am trying to build a HTML editor for use with my HTML::Mason site. I intend for it to support nested tables, SPANs, and

How do i return the end of file message in a subroutine?

2004-07-22 Thread jason corbett
I am using an application called "Title" to kick off jobs instead of using the cron. I am told that this application doesn't accept SQL embedded inside perl scripts unless the SQL or perl script returns the end of file message. What method in perl returns the eof message? is it sub myroutin

Re: Need to write a pop3 attachment fetch program

2004-07-22 Thread james derry
i should have mentioned that this is a modified script from lincoln stein's book, network programming with perl, which i highly recommend. james james derry wrote: this might not be the best-written script, but might this help? #!/usr/bin/perl # file: pop_fetch.pl #text attachments are first appe

Re: Need to write a pop3 attachment fetch program

2004-07-22 Thread james derry
this might not be the best-written script, but might this help? #!/usr/bin/perl # file: pop_fetch.pl #text attachments are first appended to a single file, then that file is re-opened for reading and its lines are first matched to one of two regular expressions. # depending on match, the line is

Re: Need to write a pop3 attachment fetch program

2004-07-22 Thread JupiterHost.Net
C.F. Scheidecker Antunes wrote: Hello all, Hello, Although I have done this same thing in PHP and Java before I have an urgent need to accomplish it in Perl due to specific requirements. What I need is to write an application that: - Access a pop3 remote account - Iterate through the list of mes

Trouble installing modules (Net::SSH::Perl, Math::Pari, Crypt::Random)

2004-07-22 Thread Price, Jason (TLR Corp)
In looking for a good Perl SSH module, I came across Net::SSH::Perl, which has a ton of dependencies. While looking into this, I stumbled across CPAN::shell, which I figured would make installing Net::SSH::Perl a lot easier. So, I installed CPAN::shell, but am unable to get all the dependencies f

Re: parsing HTML

2004-07-22 Thread Randy W. Sims
Andrew Gaffney wrote: Here is my current working code. Please take a look at it and see if there are any obvious (or not so obvious) problems. I thought this would end up being far more difficult. Looks good to me. Once you get used to the idea of event based parsing, storing context informatio

Re: string extract from email body

2004-07-22 Thread JupiterHost.Net
Richard Foley wrote: Simple question for those who know ... I want to extract 2 or 3 lines of text from an incoming email, process it and insert it into an outgoing email. Anyone got something similar Check out Mail::Internet very easy to parse email :) I use linux mail servers. If you can hav

Re: (repost) how can i generate 10 unique (non repeating) numbers

2004-07-22 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Absolut Newbie) writes: [snip] >how can i generate 10 unique (non repeating) numbers from a range to put in >the array ? http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=86hds1fa6n.fsf%40blue.stonehenge.com -- Peter Scott http://www.perl

Re: Dot not string cat?

2004-07-22 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bryan Harris) writes: >Does anyone know why this doesn't do what I expect? > >% perl -e '$i="123.52.32.1"; $j=45; $b="$i_".$j*2; print $b, "\n";' >90 > >I'd like it to print: 123.52.32.1_90 > >What's going on here? If a one-liner doesn't do what

Re: (repost) how can i generate 10 unique (non repeating) numbers

2004-07-22 Thread Flemming Greve Skovengaard
Absolut Newbie wrote: Hi, (reposting this since i did not see the original in my newsreader or google) I want to generate 10 numbers from 1..15 and put them in an array. easy ? while ($fill < 10){ $foo = int(rand(15)); unshift(@array, $foo); $fill++; } print "the [EMAIL PROTECTED] is --> @array\

Re: Dot not string cat?

2004-07-22 Thread Flemming Greve Skovengaard
Bryan Harris wrote: Does anyone know why this doesn't do what I expect? % perl -e '$i="123.52.32.1"; $j=45; $b="$i_".$j*2; print $b, "\n";' 90 I'd like it to print: 123.52.32.1_90 What's going on here? TIA. - Bryan Yoy don't have a variable called $i_. Changed '$b="$i_".$j*2;' to '$b="${i}_".$j*2;

Re: Dot not string cat?

2004-07-22 Thread Paul Johnson
On Tue, Jul 20, 2004 at 11:40:25PM -0700, Bryan Harris wrote: > Does anyone know why this doesn't do what I expect? > > % perl -e '$i="123.52.32.1"; $j=45; $b="$i_".$j*2; print $b, "\n";' > 90 perl does. Try turning on warnings. > I'd like it to print: 123.52.32.1_90 > > What's going on here

Antwort: Edit a file inplace..

2004-07-22 Thread Manfred . Beilfuss
Hi, didn't we have had this question shortly ? As I, being a perl-newbie still, remember correctly you need ( at least under windows with active state ) a extension for a backup file ! If I write : perl -pibak -ne "s/ERROR/TRACKED/g" status.log it works under win2k with active-state-perl Mit fre

string extract from email body

2004-07-22 Thread mail.outpost.ie
Simple question for those who know ... I want to extract 2 or 3 lines of text from an incoming email, process it and insert it into an outgoing email. Anyone got something similar I use linux mail servers. Thanks in advance. R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: __DATA__ Token Question

2004-07-22 Thread Thomas Bätzler
Bastian Angerstein <[EMAIL PROTECTED]> asked: > Could I change the contens of the datatoken (filehandle) > during the runtime of the skript? That depends on the OS and implementation - for some you can do that, for others you can't. And the big question is of course if you should do that. HTH, Th

Rounding a negative number

2004-07-22 Thread PerlDiscuss - Perl Newsgroups and mailing lists
$item = sprintf("%0.2f", $item); print $item, "\n"; The above code prints -992.99 if $item = -993, while it prints 993.00, if $item = 993. Why is the rounded number off by 0.01 if the number is negative? Thanks, SU -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

reports

2004-07-22 Thread Flatman
how to create nice looking reports in perl . With font effects + some graphics (like horizontal lines every 3 records ...) thanks erik -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

(repost) how can i generate 10 unique (non repeating) numbers

2004-07-22 Thread Absolut Newbie
Hi, (reposting this since i did not see the original in my newsreader or google) I want to generate 10 numbers from 1..15 and put them in an array. easy ? while ($fill < 10){ $foo = int(rand(15)); unshift(@array, $foo); $fill++; } print "the [EMAIL PROTECTED] is --> @array\n"; my problem is

Dot not string cat?

2004-07-22 Thread Bryan Harris
Does anyone know why this doesn't do what I expect? % perl -e '$i="123.52.32.1"; $j=45; $b="$i_".$j*2; print $b, "\n";' 90 I'd like it to print: 123.52.32.1_90 What's going on here? TIA. - Bryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: find out who was online at a given time

2004-07-22 Thread Philipp Traeder
On Tuesday 20 July 2004 18:34, [EMAIL PROTECTED] wrote: > Ok, this may or may not be a tricky one I will try and be succinct in my > statement. > > I have a database (mysql 4.0) with radius log entries for each day, we > receive emails about Acceptable Use Abuses and must figure out exactly > who w

building DBI

2004-07-22 Thread Christian Stalp
Hallo again, I still hanging at my problem with buidling the Perl:DBI - module! My enviroment is: Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: Platform: osname=hpux, osvers=10.20, archname=PA-RISC2.0 uname='hp-ux imserv03 b.10.20 a 9000810 2015410517 two-user

Edit a file inplace..

2004-07-22 Thread Steve . E . Pittman
Hi, I am trying to edit an ASCII file in placeâ I tried â perl -pi -ne "s/ERROR/TRACKED/g" status.log and receivedâ Can't do inplace edit without backupâ Any help is appreciatedâ Thanks, Steve

generating non repeating numbers.

2004-07-22 Thread Absolut Newbie
Hi, I want to generate 10 numbers from 1..15 and put them in an array. easy ? while ($fill < 10){ $foo = int(rand(15)); unshift(@array, $foo); $fill++; } print "the [EMAIL PROTECTED] is --> @array\n"; my problem is that many times the numbers repeat themselves in the array. how can i generat

Pls help for my perl scripts

2004-07-22 Thread Ar fat
Dear all Pls help to see for my 1st testing nntp perl scripts. I would like to have a perl scripts which can be posting the news automated. Does any 1 have an ideas ? million thx. #!/usr/local/bin/perl -Tw use strict; use Net::NNTP; use Mail::Header; my $nntpserver = 'xxx.com'; $nntp = Net::NN

Re: Perl and XML::Simple

2004-07-22 Thread Philipp Traeder
On Monday 19 July 2004 HH:04:06, David Arnold wrote: > All Good morning, > > I tried to run this: > [..] > my $resp_xml=XMLin('./Responses.xml',forcearray=>1); > > print Dumper $resp_xml; > > On this file: > > [EMAIL PROTECTED] perlxml]# cat -A Responses.xml > > And I got this error message: >

printing reports

2004-07-22 Thread Flatman
hi all ! what would be the best (and easiest) module for printing reports (data based) . I need : - graphical printing (postscript or whatever) to printer since i need formatting (bold..) and images I'd like : - page numbering - easy row counting (I don't like to have to count rows before sen

string extract from email body

2004-07-22 Thread Richard Foley
Simple question for those who know ... I want to extract 2 or 3 lines of text from an incoming email, process it and insert it into an outgoing email. Anyone got something similar I use linux mail servers. Thanks in advance. R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: __DATA__ Token Question

2004-07-22 Thread Owen Cook
On Thu, 22 Jul 2004, Bastian Angerstein wrote: > some weeks ago I had a question regarding The DATA-Token. > > Now there is anonther one: > > Could I change the contens of the datatoken (filehandle) > during the runtime of the skript? > > If anyone has an idea I would be grateful. I am not s