Safe.pm

2002-08-21 Thread Avi Nehori
Hello! did somebody here ever used the safe.pm module? please HELP!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help parsing a large file

2002-08-21 Thread Dharmendra Rai
Max, use the following algo for ur work: create 2 hash-tables for good and bad addresses. the keys are the domain part of the e-mail addresses. the value part is the reference to an array of id part of the e-mail address. instead of reading data into ur GOOD and BAD fd's , read t

Re: Can I add a path to @INC

2002-08-21 Thread Connie Chan
- Original Message - From: "Brian Oh" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 22, 2002 2:45 PM Subject: Can I add a path to @INC > Hi > I am using solaris and perl5.6.1. > And I got an error saying it can not locate TK/ListBox.pm in > @INC. 1. Are you sure y

don't known which module I need

2002-08-21 Thread Gaƫl Blanchet
Hello I need to write a script which give mac address when I give IP address of my LAN. But I can't find which module I need to use. If someone knows it, can he help me. Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Can I add a path to @INC

2002-08-21 Thread Brian Oh
Hi I am using solaris and perl5.6.1. And I got an error saying it can not locate TK/ListBox.pm in @INC. And @INC does not include the path to TK/ListBox.pm. How can I add the path to TK/ListBox.pm to @INC? Thanks. -Brian _ Send and

IDE's

2002-08-21 Thread Stan Benner
I'm using Komodo from Active State and find it very slow when running code. Can anyone recommend a Windows based app that provides an IDE that I can run perl code in? I'm totally new to perl and would prefer not using notepad to write perl code and then using the dos window for output. Any help?

Help parsing a large file

2002-08-21 Thread Max Clark
Hi, I am trying to parse a large text file (10 MB, 400K lines) with the following code. This is running FreeBSD-Stable (dual proc, 1GB ram), however I keep receiving messages that I am out of memory, or that the "query timed out". I need to parse a file with email addresses to sort out garbage.

Re: browser redirect

2002-08-21 Thread drieux
On Wednesday, August 21, 2002, at 03:46 , Dave Smith wrote: [..] > Okay, I've got it figured out. Thanks for you help. I'll just > redirect the print commands to run the new headers depending on > browser versions. [..] > > if ($ENV{HTTP_USER_AGENT} =~ /Mozilla\/4/i > and not $ENV{'HTTP_US

Re: browser redirect

2002-08-21 Thread Dave Smith
Okay, I've got it figured out. Thanks for you help. I'll just redirect the print commands to run the new headers depending on browser versions. --Dave #!/usr/local/bin/perl5 use CGI qw(:all); # 'cause I'm lazy like that print header(), start_html(); if ($ENV{HTTP_USER_AGENT} =~ /Mozilla

Re: exporter

2002-08-21 Thread drieux
On Wednesday, August 21, 2002, at 02:26 , [EMAIL PROTECTED] wrote: [..] p0: there is a virtue in my $got_back = DTK::Flying::Wombat::flap(@funny); since you know exactly what module you got that flap() from. the alternative here is that you opt for what are known as 'utility classes' -

Re: Regex to split router ifDescr up

2002-08-21 Thread John W. Krahn
Janek Schleicher wrote: > > John W. Krahn wrote at Tue, 20 Aug 2002 22:43:55 +0200: > > > > You can use \d instead of [0-9], \D instead of [^0-9] and \S instead of > > [^\s]. > > > > /^(\D+)(\d+ |)(\d+\/\S+)(.*)$/ > ^^^ > > That's still an ugly and slow way to have an optional match

how to write inside crontab without crontab?

2002-08-21 Thread P lerenard
Hi, i'm triing to change my crontab file remotely. but if I don't use crontab command the system is not going to take the change. so I get @res=qx{crontab -l} but i don't change anything I open crontab with vi, is it possible to make a cmd like {crontab -l | vi -c i linexxx | vi -c :q} sounds r

Re: Problem with Hashes ??

2002-08-21 Thread pn
Hi I am having trouble getting the following script to work. This is a script that I have inherited and am hacking to get it work. In this code, the following check is failing: # Enter Foreach Loop foreach $net (keys %nets) { print "Inside Foreach Loop\n"; print "The value of \$net is : $n

if question

2002-08-21 Thread Lance Prais
If I wanted to have a multiple if statement how would I do that. For example I would like to say IF this and that and they are true Do this Would it look like this? if ($url_array[$index] eq "False"|| $url_array[$index] eq "false"|| $url_array[$index] eq "FALSE"||) { Do this This does not seem t

AppConfig problem

2002-08-21 Thread Jeremy Vinding
hi... i'm trying to use AppConfig, but i'm getting the following error: dir: no such variable at /home/sheila/loserspool/loserspool.conf line 1 when running this code: $config = AppConfig->new ({ERROR => sub {die shift}}); $config->file ('/home/sheila/loserspool/loserspool.conf'); with this

Re: substituting a string in a file

2002-08-21 Thread david
Felix Geerinckx wrote: >> s/\d{8}/$date/go; > > Why are you introducing the compile-once-modifier when there is no > variable to interpolate in the pattern? > oops.. just realize that... better pay more attention next time :-) > Also, if you are taking on the job of correcting other posters' (a

Re: browser redirect

2002-08-21 Thread Connie Chan
- Original Message - From: "zentara" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 21, 2002 9:14 PM Subject: Re: browser redirect > On Tue, 20 Aug 2002 15:25:41 -0700 (PDT), [EMAIL PROTECTED] (Dave > Smith) wrote: > > >I'm trying to write a program that will redi

Re: Automate info retrieval

2002-08-21 Thread david
a lot of info/detail is missing, the following might be able to get you started: #!/usr/bin/perl -w use strict; use LWP::UserAgent; my $ua = new LWP::UserAgent; my $usr = 'user'; my $psw = 'psw'; foreach my $url (qw(url1 url2 url3 url4)){ my $req = new HTTP::Request GET => $url;

Re: browser redirect

2002-08-21 Thread Dave Smith
Howdy Zentara, That one is closer than what my code was doing. It's printing out the tipsy.cgi (that reads "Netscape 4 page"), instead of surly.cgi (reading "anti-Netscape 4 page"). But it directs IE 6, Mozilla 1, and Netscape 4.7 to the Netscape 4 page, instead of only the Netscape 4.7 page

Re: where to put data files

2002-08-21 Thread drieux
On Wednesday, August 21, 2002, at 10:06 , Paul Tremblay wrote: > I am writing a script that converts RTF to XML, and this script needs > to read an external data file to form a hash. I plan to make this > script available to anyone who needs it, and am wondering what to do > with this external d

Automate info retrieval

2002-08-21 Thread Ed Andrews
How does one create a program to: 1. log into a secure web site which requires a username and password 2. "click", or go to a specific web page within the site, parsing info from it 3. from data received from page, repeat step 2 Ed Andrews [EMAIL PROTECTED] 515-707-2000 phone 866-299-0676

Re: substituting a string in a file

2002-08-21 Thread Felix Geerinckx
on Wed, 21 Aug 2002 17:30:17 GMT, David wrote: > Felix Geerinckx wrote: >> s/\d{8}/$date/g; > > s/\d{8}/$date/go; Why are you introducing the compile-once-modifier when there is no variable to interpolate in the pattern? Also, if you are taking on the job of correcting other posters

Re: Moving directories

2002-08-21 Thread david
do the following: mkdir "two"; chdir "two"; mkdir "one"; if you need to do something else, you need to move back to where you are after the second mkdir david David Richardson wrote: > Is there any way to have a perl script move one directory into > another like: > > $ mkir one two >

Re: Regex to split router ifDescr up

2002-08-21 Thread Shawn
On 08/21, P lerenard said something like: > Hi, > why you dont use 2 split or 2 substr > ethernet t and pos are letter the rest is number > if you get the position of the last letter you just have to split the > string, one for the string the rest for the details. That should be quicker. the fir

Re: Regex to split router ifDescr up

2002-08-21 Thread Shawn
On 08/21, Janek Schleicher said something like: > John W. Krahn wrote at Tue, 20 Aug 2002 22:43:55 +0200: > > > Shawn wrote: > > You can use \d instead of [0-9], \D instead of [^0-9] and \S instead of > > [^\s]. > > > > /^(\D+)(\d+ |)(\d+\/\S+)(.*)$/ > ^^^ > > That's still an ugly

Re: Remove elements in an array from a different array

2002-08-21 Thread david
@h{@arr1}=(); delete @h{@arr2}; print join("\n",keys %h),"\n"; david Priss wrote: > Hello, > > I am very new to Perl, wonder if someone can help me > with this... if I have: > > @arr1 = qw (one two three four five); > @arr2 = qw (two four); > > How can I remove all elements from @arr2 from @

Re: substituting a string in a file

2002-08-21 Thread david
Felix Geerinckx wrote: > on Wed, 21 Aug 2002 11:33:06 GMT, [EMAIL PROTECTED] wrote: > >> I'm trying to substitute all references to a date (of the format >> MMDD) in a file to the current date. I'm obviously doing >> something wrong here ('cause it doesn't work!:}), as no change is >> made

Re: Help!! Retrieving Image File

2002-08-21 Thread David Zhuo
where do you get the impression that \n\n is for text file and \r\n\r\n is for binary data??? did you get that somewhere? \r\n\r\n is OS specific but \n\n is portable. does Win32 and UNIX-ish use the same crlf? your best beat is to use \n\n where Perl will translate(transparently in the background

where to put data files

2002-08-21 Thread Paul Tremblay
I am writing a script that converts RTF to XML, and this script needs to read an external data file to form a hash. I plan to make this script available to anyone who needs it, and am wondering what to do with this external data file. Should I simply make the data file available with the script

Re: Where to start ? Listening to a port ...

2002-08-21 Thread John W. Krahn
Felix Geerinckx wrote: > > on Wed, 21 Aug 2002 09:47:49 GMT, [EMAIL PROTECTED] (Connie Chan) > wrote: > > > What my approach is to write my own mail server. So can block > > address, or matched content pattern immediately. But what my first > > step is ... how to listening to my SMTP port ? Woul

Re: Where to start ? Listening to a port ...

2002-08-21 Thread Peter Scott
At 05:47 PM 8/21/02 +0800, Connie Chan wrote: >I am working on a Win32 system, what now I am to do is checking and >blocking spams on my mail server. Recently, I use a software mail server >to receving mails, but, there is not filter features. What my approach is to >write my own mail server. So c

Re: Regex to split router ifDescr up

2002-08-21 Thread P lerenard
Hi, why you dont use 2 split or 2 substr ethernet t and pos are letter the rest is number if you get the position of the last letter you just have to split the string, one for the string the rest for the details. That should be quicker. Pierre >From: Shawn <[EMAIL PROTECTED]> >To: [EMAIL PROT

RE: Remove elements in an array from a different array

2002-08-21 Thread Shishir K. Singh
>use hashes. >my %HASH; >$HASH{$_}++ foreach @arr1; >delete $HASH{$_} foreach @arr2; >@arr1 = keys %HASH; > @arr1 now has ( one three five ); Perhaps If you want to maintain the order in the array, you might use it this way: my %HASH; my %hORD; my $count = 0; $HASH{$_} = ($count++) for @arr1

RE: Moving directories

2002-08-21 Thread Timothy Johnson
Check out Win32::FileOp. -Original Message- From: David Richardson To: [EMAIL PROTECTED] Sent: 8/21/02 8:48 AM Subject: Moving directories Is there any way to have a perl script move one directory into another like: $ mkir one two $ mv one two $ ls two one without ha

Moving directories

2002-08-21 Thread David Richardson
Is there any way to have a perl script move one directory into another like: $ mkir one two $ mv one two $ ls two one without having to use system? I tried use File::Copy; mkdir 'one'; mkdir 'two'; move('one', 'two'); but this renames one to two and overwrite

Re: Help!! Retrieving Image File

2002-08-21 Thread Connie Chan
[.] > > #!/usr/local/bin/perl -w > use strict; > > open IMAGE, 'test.jpg' or die "Failed to open image $!"; > my $buf_chunk_size = 1024 * 16; > my $buffer; > binmode IMAGE; > binmode STDOUT; > > print "Content-Type: image/jpeg\n\n"; > print $buffer while read IMAGE, $buffer, $buf_chunk_siz

Re: Help!! Retrieving Image File

2002-08-21 Thread Bill Moseley
At 05:56 PM 08/21/02 +0800, Connie Chan wrote: >No... I believe. I've digging on this topic for very very long >time on my Win32, Sambar and Apache server. > >I can't print any image out without \r\n\r\n, where \n\n is for >text file only. Why? I don't know =) Guess, because \r\n is for >*binmod

Problem with 'install Device::SerialPort'

2002-08-21 Thread Gary Stainburn
Hi all, Below is my session log showing me trying to install Device::SerialPort. Can anyone tell me why it's failing please. Gary cpan> install Device::SerialPort Running install for module Device::SerialPort Running make for C/CO/COOK/Device-SerialPort-0.12.tar.gz Is already unwrapped into

Re: inserting a single word in every file

2002-08-21 Thread Sudarshan Raghavan
On Wed, 21 Aug 2002, Nandita wrote: > Thanks, but I forgot to mention in the beginning that i need to make this > modification only ONCE in my file- the ">" character comes up every few > lines, but I only want the title "ALIGNMENTS" in the beginning..i.e, it > shd not replace all the ">"s in my

Re: inserting a single word in every file

2002-08-21 Thread Nandita
Thanks, but I forgot to mention in the beginning that i need to make this modification only ONCE in my file- the ">" character comes up every few lines, but I only want the title "ALIGNMENTS" in the beginning..i.e, it shd not replace all the ">"s in my file.. ? sorry about that! -thanks, nandita

Re: browser redirect

2002-08-21 Thread zentara
On Tue, 20 Aug 2002 15:25:41 -0700 (PDT), [EMAIL PROTECTED] (Dave Smith) wrote: >I'm trying to write a program that will redirect people looking at a >site using Netscape 4. (I have a header that looks good in Mozilla, >Netscape 6, and IE, but looks pretty crappy in Netscape 4). > >I'm new at p

RE: Remove elements in an array from a different array

2002-08-21 Thread Nikola Janceski
See inline comment: > -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 21, 2002 8:58 AM > To: 'Priss'; [EMAIL PROTECTED] > Subject: RE: Remove elements in an array from a different array > > > use hashes. > > my %HASH; > $HASH{$_}++ foreac

Re: Remove elements in an array from a different array

2002-08-21 Thread Sudarshan Raghavan
On Wed, 21 Aug 2002, Priss wrote: > Hello, > > I am very new to Perl, wonder if someone can help me > with this... if I have: > > @arr1 = qw (one two three four five); > @arr2 = qw (two four); This is a faq, perldoc -q intersection Although for this kind of operations a hash might be better op

RE: Remove elements in an array from a different array

2002-08-21 Thread Nikola Janceski
use hashes. my %HASH; $HASH{$_}++ foreach @arr1; delete $HASH{$_} foreach @arr2; @arr1 = keys %HASH; @arr1 now has ( one three five ); > -Original Message- > From: Priss [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 21, 2002 8:54 AM > To: [EMAIL PROTECTED] > Subject: Remove elem

Re: substituting a string in a file

2002-08-21 Thread Sudarshan Raghavan
On Wed, 21 Aug 2002 [EMAIL PROTECTED] wrote: > Hi, > > I'm trying to substitute all references to a date (of the format > MMDD) in a file to the current date. I'm obviously doing something > wrong here ('cause it doesn't work!:}), as no change is made to the > config.ini file. > the $date

Remove elements in an array from a different array

2002-08-21 Thread Priss
Hello, I am very new to Perl, wonder if someone can help me with this... if I have: @arr1 = qw (one two three four five); @arr2 = qw (two four); How can I remove all elements from @arr2 from @arr1 so the new array will be @newarr = (one three five)?? Many thanks. Priss _

Re: substituting a string in a file

2002-08-21 Thread Felix Geerinckx
on Wed, 21 Aug 2002 11:33:06 GMT, [EMAIL PROTECTED] wrote: > I'm trying to substitute all references to a date (of the format > MMDD) in a file to the current date. I'm obviously doing > something wrong here ('cause it doesn't work!:}), as no change is > made to the config.ini file. > open

Re: Regex to split router ifDescr up

2002-08-21 Thread shawn_milochik
Oops, I think you confused me with someone else. I did not ask this question. Shawn [EMAIL PROTECTED]

substituting a string in a file

2002-08-21 Thread afarrell
Hi, I'm trying to substitute all references to a date (of the format MMDD) in a file to the current date. I'm obviously doing something wrong here ('cause it doesn't work!:}), as no change is made to the config.ini file. the $date variable is derived form another part of my script. thanks,

Re: Net::Telnet problem Timed-out waiting for command prompt

2002-08-21 Thread Felix Geerinckx
on Wed, 21 Aug 2002 11:18:54 GMT, [EMAIL PROTECTED] (Ashish Srivastava) wrote: > i am using Net::Telnet module. > it works fine for some users while for others it give this error > message: Timed-out:waiting for command prompt > I think this problem is concern with mounting of home directory of

Re: Where to start ? Listening to a port ...

2002-08-21 Thread Felix Geerinckx
on Wed, 21 Aug 2002 09:47:49 GMT, [EMAIL PROTECTED] (Connie Chan) wrote: > What my approach is to write my own mail server. So can block > address, or matched content pattern immediately. But what my first > step is ... how to listening to my SMTP port ? Would anybody can > point me to somewhere

Re: Perl IDE's v. Perl Editors was Re: Editor

2002-08-21 Thread Ramprasad A Padmanabhan
I dont agree that vim is the most popular editor in the linux world I have seen more of emacs being used Features like syntax check , auto indent etc and keyboard macros make emacs my favourite Editor Nikola Janceski wrote: > see inline comments > > >>-Original Message- >>From: Paul

Net::Telnet problem Timed-out waiting for command prompt

2002-08-21 Thread Ashish Srivastava
hi everybody, i am using Net::Telnet module. it works fine for some users while for others it give this error message: Timed-out:waiting for command prompt I think this problem is concern with mounting of home directory of users. How can i get rid of this problem. * Thanks in adva

perl cokies

2002-08-21 Thread develop.netcore
Where do I start from to begin with perl cookies I plan to have cookies for session management Thanx Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Safe.pm

2002-08-21 Thread Avi Nehori
Hello! did somebody here ever used the safe.pm module? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: need help extracting words from a string - Thanks and need more help

2002-08-21 Thread Connie Chan
> Is it possible to test if a hash variable is set? My thinking is something kinda >like this: > > if ( $hashname[variable] ) { > do something smart again ; > } that's $hashname{variable}, not [variable]... Yes, you can do that, but if you also turned on warnings, you will receive a war

Re: Help!! Retrieving Image File

2002-08-21 Thread Connie Chan
No... I believe. I've digging on this topic for very very long time on my Win32, Sambar and Apache server. I can't print any image out without \r\n\r\n, where \n\n is for text file only. Why? I don't know =) Guess, because \r\n is for *binmoded data*. And without binmode STDOUT and IMAGE both.

Re: Where to start ? Listening to a port ...

2002-08-21 Thread Mat Harris
have a look at this. is has quite a good multithread-capable server. http://www.perldoc.com/perl5.6.1/pod/perlipc.html#Sockets--Client-Server-Communication On Wed, Aug 21, 2002 at 05:47:49 +0800, Connie Chan wrote: > I am working on a Win32 system, what now I am to do is checking and > blocking

Where to start ? Listening to a port ...

2002-08-21 Thread Connie Chan
I am working on a Win32 system, what now I am to do is checking and blocking spams on my mail server. Recently, I use a software mail server to receving mails, but, there is not filter features. What my approach is to write my own mail server. So can block address, or matched content pattern immed

Re: Global variables

2002-08-21 Thread Connie Chan
I learnt something about this for days only, so don't know if there are bugs here : # Create a package glob_vars.pm # package glob_vars; require Exporter; our @ISA = qw (Exporter); our @EXPORT = qw (%VARS) our %VARS = (); $VARS{sth_a} = 'sth_a'; $VARS{sth_b} = 'sth_b'; 1; # End of package # #

Re: regular expression (fwd)

2002-08-21 Thread Sudarshan Raghavan
Sorry!! again, failed to send to the list -- Forwarded message -- Date: Thu, 22 Aug 2002 00:29:11 +0530 (IST) From: Sudarshan Raghavan <[EMAIL PROTECTED]> To: Javeed SAR <[EMAIL PROTECTED]> Subject: Re: regular expression On Wed, 21 Aug 2002, Javeed SAR wrote: > # I want to gre

Re: regular expression

2002-08-21 Thread Felix Geerinckx
on Wed, 21 Aug 2002 08:02:02 GMT, [EMAIL PROTECTED] (Javeed Sar) wrote: > # I want to grep for files with .dsp or .vbp extensions here, > if the number of files with extension .dsp or .vbp is > 1 i > should exit saying project exists. or else send mail. > > am i doing the right thing? No y

Re: How to find out, whether a file with a specific file ending exists ? (was: regular expression)

2002-08-21 Thread Janek Schleicher
Javeed Sar wrote at Wed, 21 Aug 2002 09:50:02 +0200: > @file=`ls $ja`; > > #Here the output is a list of files: > cp.exe > eula.txt > test2.vbp.mkelem Should this file matched too or not ? I assume in my solution that it isn't. > test3.vbp > > > # I want to grep for files with .dsp or .vbp

Re: How to find all modules CPAN alternates

2002-08-21 Thread Janek Schleicher
Dizzy74 wrote at Wed, 21 Aug 2002 03:55:38 +0200: > Im wondering how does one know what modules are available? > Is there a master list with accompanying methods? > Or is CPAN the only source? > http://cpan.org/ > > Sometimes CPAN seems much too cryptic for a beginner(at least from my view)

64 bits and perl 5.6.1

2002-08-21 Thread BUFFERNE,VINCENT (Non-HP-France,ex1)
Hi all, I want to use perl compiled in 64 bits. Do you think perl 5.6.1 is mature enough regarding 64 bits compliance ? Do you have already test it ? Then I want to load Shared libraries produced with XS. I would like to be able to load either 32 bits or 64 bits shared libraries with the same per

Re: how to make a regex for a ip address

2002-08-21 Thread Ask Bjoern Hansen
[EMAIL PROTECTED] (Perl-Krackedpress) writes: > // check the email fields for validity > "^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$" That will invalidate lots of proper email addresses. For example anything in the .info domain. For example [EMAIL PROTECTED] is also a valid em

regular expression

2002-08-21 Thread Javeed SAR
Hi all, @file=`ls $ja`; #Here the output is a list of files: cp.exe eula.txt test2.vbp.mkelem test3.vbp # I want to grep for files with .dsp or .vbp extensions here, if the number of files with extension .dsp or .vbp is > 1 i should exit saying project exists. or else send mail. am i do