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]

Re: newline to

2004-06-28 Thread Papo Napolitano
> Papo Napolitano wrote: > > Charles Farinella wrote: > >> > >>$text =~ s/\r\n//g; > >> > >>doesn't work. > > > > $text =~ s/\r\n//gs; > ^ > > Why would the /s modifier make a difference? Please study

Re: newline to

2004-06-28 Thread Papo Napolitano
> I have a textarea on a webpage that gets stored in a database. I'd like > to convert the newline to an HTML before it gets stored so when > I display it, the line breaks as it was typed. I've been looking around > but haven't found an example. > > $text =~ s/\r\n//g; > > doesn't work. > >

MIME::Entity fills my memory

2004-06-15 Thread Papo Napolitano
Hi, I just discovered this code: #!/usr/bin/perl use warnings; use strict; use MIME::Entity; while (1) { my $msg = MIME::Entity->build( From => 'TEST <[EMAIL PROTECTED]>', Sender => '[EMAIL PROTECTED]', To => '[EMAIL PROTECTED]', Subject => 'TEST', Encoding =

Re: Help with Net::FTP behaviour

2004-06-02 Thread Papo Napolitano
> What is unexpected about this? Your error is being caught, and the > first line is just a warning, and a pretty useful one at that. >From the Net::FTP documentation: get ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] ) Get "REMOTE_FILE" from the server and store locally. "LOCAL_FILE" may be a filen

Help with Net::FTP behaviour

2004-06-02 Thread Papo Napolitano
I have this little piece of code: -- CUT -- #!/usr/bin/perl use strict; use warnings; use Net::FTP; my $address = "localhost"; my $port = 21; my $user = "test"; my $pass = "test"; my $sourcedir = "/test/"; my $sourcemask = "*"; my $destdir = "/tmp/test/"; my $ftp = Net::FTP->new( $address,

Re: question about select

2004-02-19 Thread Papo Napolitano
> Papo Napolitano wrote: > > >> On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: > >> > >> > Heh, sorry... I simplified the code... > >> > I'm still not posting the full source because it's like 15 files :( > >> >

Re: question about select

2004-02-18 Thread Papo Napolitano
> On Feb 18, 2004, at 3:50 PM, Papo Napolitano wrote: > > > Hi! > > > > I'm using the "select undef, undef, undef, 60" trick to sleep for 60 > > seconds. > > But it seems to not work after I do a couple of forks like this: > > > >

Re: question about select

2004-02-18 Thread Papo Napolitano
> On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: > > > Heh, sorry... I simplified the code... > > I'm still not posting the full source because it's like 15 files :( > > > > > > while (1) { > > Fork("Whatever"); > >

Re: question about select

2004-02-18 Thread Papo Napolitano
> On Feb 18, 2004, at 3:50 PM, Papo Napolitano wrote: > > > Hi! > > > > I'm using the "select undef, undef, undef, 60" trick to sleep for 60 > > seconds. > > But it seems to not work after I do a couple of forks like this: > > > >

question about select

2004-02-18 Thread Papo Napolitano
Hi! I'm using the "select undef, undef, undef, 60" trick to sleep for 60 seconds. But it seems to not work after I do a couple of forks like this: while (1) { Fork('sub1'); Fork('sub2'); Fork('sub3'); select undef, undef, undef, 60; } "Fork" just fork and run the supplied sub in the new

Re: Loading and using modules using eval (SOLVED)

2004-01-26 Thread Papo Napolitano
- Original Message - From: "drieux" <[EMAIL PROTECTED]> To: "Perl Beginners Mailing List" <[EMAIL PROTECTED]> Sent: Friday, January 23, 2004 19:53 Subject: Re: Loading and using modules using eval > IF the Text::process and XML::process functions are things > that you are building out yo

Loading and using modules using eval

2004-01-23 Thread Papo Napolitano
Hi all, I have this piece of code: my @modules = ( 'Module1', 'Module2', 'Module3', 'ModuleX', 'ModuleY', 'Blah', ); my $param1 = "whatever"; my $param2 = 0; for my $module (@modules) { $param2++; eval("require $module"); if ($@) { print "$module Not found\n"; } else { eval("&${

Re: perl serial port program

2002-03-01 Thread Papo Napolitano
o return an entire line (up to the first \n or \r)... If you intend to read -only- one char, you should check Device::SerialPort docs... There's plenty of examples =) Later.- - Original Message - From: Jeff Liu To: Papo Napolitano ; Beginners Sent: Friday, March 01, 2002 17:17 Su

Re: perl serial port program

2002-02-28 Thread Papo Napolitano
I'm using the Device::SerialPort to monitor the logs from our Panasonic phone system ;) Take a look at CPAN. It's as easy as: use Device::SerialPort; $port = new Device::SerialPort("/dev/ttyS0"); $port->baudrate(9600); $port->parity("none"); $port->databits(8); $port->stopbits(1); $port->handsha

Re: [Going OT] Re: making phone calls using a perl module

2002-02-28 Thread Papo Napolitano
Heh, I was right ;) Check this: http://www.zoltrix.com/PUBLIC/MODEM/ATmanual/ATVROCK.HTM Quoting: 8.1.3. Voice Transmit Mode Voice Transmit Mode is entered when the DTE issues the #VTX command because it wants to transmit voice data. This mode is typically used when playing back greeting messag

Re: making phone calls using a perl module

2002-02-28 Thread Papo Napolitano
Yes, I think you're wrong. Try this from a DOS box echo ATDT11 > com1 If you have your modem in com1 of course... ;) - Original Message - From: Tor Hildrum To: Papo Napolitano Sent: Thursday, February 28, 2002 11:53 Subject: Re: making phone cal

Re: making phone calls using a perl module

2002-02-28 Thread Papo Napolitano
I'm making a guess here... But I think voice modems use the (standart) AT commands even for the voice commands. So if you know what to send, just use something like Device::SerialPort to dial via the modem and for the mp3 play, you could "inject" the audio signal coming from your soundcard to the

GENERAL REGEXP TIP NEEDED

2001-12-27 Thread Papo Napolitano
Hi all, I have the regexp /\<(br|b|\/b|a\s.*?|\/a|p|\/p)\>/ which works as expected, matching Now, how do I negate it? I mean, what would be the regexp to match every tag BUT those listed above? I'm really lost... TIA =) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Data through the parallel port

2001-12-20 Thread Papo Napolitano
I don't know of a module... But I managed to use the parallel port to detect a button push with plain old Perl code =) Here's a snippet: sysopen IOPORT, "/dev/port", O_RDONLY; # Open LPT Port sysseek IOPORT, 889, 0 or die "sysseek() failed: $!\n"; # Select Port 0x379 $nstatus = sysread IOPORT, $s

Re: Off-Topic (200%) - Where are you from?

2001-11-09 Thread Papo Napolitano
Argentina (Argentine) -- #1 in the Country Risk Table Go Argentine Staying on top with 2446 basic points (2001-11-09 14:00) -- Fu country... >- Original Message - >From: Etienne Marcotte >To: [EMAIL PROTECTED] >Sent: Friday, November 09, 2001 12:08 PM >Subject: Off-Topic (

Silly sockets question

2001-11-08 Thread Papo Napolitano
Hi list! I was wondering what's the difference between using: 1) $blah = pack('S n a4 x8', 2, 80, (gethostbyname("whatever.com"))[4]); 2) $blah = pack('S n a4 x8', 2, 80, inet_aton("whatever.com")); 3) $blah = sockaddr_in(80, inet_aton("whatever.com")); 4) $blah = sockaddr_in(80, (gethostbyname(

Re: pattern matching

2001-07-22 Thread Papo Napolitano
Use either --- while (($line=)) { chomp($line); if (!($line =~ /^\d/)) { print OUTDATA "$line **unchanged** \n"; next; } else { blah blah blah --- or --- while () { chomp

Broadcast AGAIN

2001-07-15 Thread Papo Napolitano
Well, seems my previous post didn't success, so I'll try another approach... Pleeease anyone know how to send an UDP (or TCP, or ICMP, I don't care) chunk of data (AKA packet) to EVERY host on an internal subnet (10.0.0.0)? Sending to 10.0.0.255 or 255.255.255.255 doesn't work. And I swear I

IO::Socket:INET and broadcasting

2001-07-12 Thread Papo Napolitano
Hi, this is my first post, so don't blame me (too much) if i'm posting to the wrong list. I'm working on a very simple client/server program in Perl... A server broadcasts udp packets with some info that a couple of clients then collect & display. Well, could anyone tell me what's the mistake in t