Remove Newlines from String

2016-09-06 Thread Matt
I am receiving log entries as a string and then writing them to a file with the date tacked on beginning. Problem is that sometimes the string I receive contains \n and it makes parsing the file with grep more difficult. Looking for a simple way to replace all \n in the string with text or somet

Perl Ping

2014-08-24 Thread Matt
Looking at ping in perl. http://perldoc.perl.org/Net/Ping.html Ii do not see a way to ping with a pattern the way it is allowed under shell with -p. http://linux.about.com/od/commands/l/blcmdl8_ping.htm Is there a way to use pattern without resorting to shell?

Re: Invoking a script in Windows 7

2014-03-09 Thread Matt McAdory
ndoze tolerably usable for me so I do wish you luck in your endeavor). http://cygwin.com/ml/cygwin/2004-07/msg00163.html Matt === *Clarke's Three Laws* 1. When a distinguished but elderly scientist states that something is possible, he is almost certainly right.

Re: Invoking a script in Windows 7

2014-03-08 Thread Matt McAdory
This isn't a perl programming issue, but a cygwin/windoze environmental execution issue. Please use the appropriate list to seek further assistance. http://cygwin.com/lists.html http://cygwin.com/ml/cygwin/2004-07/msg00163.html On Sat, Mar 8, 2014 at 6:25 PM, Yonghua Peng wrote: > You may want

Re: Installing Perl and CPAN local

2014-03-04 Thread Matt McAdory
let me suggest you start here: http://bit.ly/1lwoehv and http://www.catb.org/~esr/faqs/smart-questions.html and then report back with specific questions or problems you are having. Matt === *Clarke's Three Laws* 1. When a distinguished but elderly scientist s

Re: String in Array

2014-02-20 Thread Matt
> Having trouble making this work. > > my @alarm = ("xyz", "abc"); > my $name = "ab"; > unless (grep {/$name/} @alarm) { # do this } > > Since "ab" is contained in the array I want it to NOT 'do this'. What > have I got wrong? If I set 'my $name = "abc";' it seems to match. But I want to match

String in Array

2014-02-20 Thread Matt
Having trouble making this work. my @alarm = ("xyz", "abc"); my $name = "ab"; unless (grep {/$name/} @alarm) { # do this } Since "ab" is contained in the array I want it to NOT 'do this'. What have I got wrong? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

Re: Identifying the current opened filehandle for writing as I'm getting undefined variable concatenation errors

2014-01-14 Thread Matt McAdory
en I added provides enough time for $thing return some data. I will experiment with sleep(5). I would use expect for the telnet session, but this has to be run by activeperl on a windows platform. :/ I'd use the alternative for expect if I had the choice. Thanks again for looking. Matt On Tu

Identifying the current opened filehandle for writing as I'm getting undefined variable concatenation errors

2014-01-14 Thread Matt McAdory
nt way of doing what I'm doing. Should that BOOM always be: if (undef $FH) {open (my $FH, ">>", "filename.txt");} print $FH "$thing\n"; close $FH; A friendly page in the fine manual to read. A nudge towards a llama or camel reference would be appreciated. Several days show my googlefu to be lacking. Where is my rookie mistake? Matt

Re: Problem installing Log::Log4perl using Strawberry Perl on Windows

2013-11-25 Thread Matt McAdory
log4perl-de...@lists.sourceforge.net as the prior link suggests. Matt On Mon, Nov 25, 2013 at 9:06 AM, Shaji Kalidasan wrote: > Dear Perlers, > > I tried installing Log::Log4perl on Windows (Strawberry Perl Version > 5.18.1) but I could not install using both 'cpan' and 'c

Filtering Characters

2013-09-03 Thread Matt
I have this: while () { chomp; next if /^#/; # do stuff } It skips to the next item in the while loop of the string begins with # and works fine. I would also like to skip to the next item in the loop if the string contains anything other then lowercase, underscores, numbers, da

Attempting to be more perl-ish

2012-11-09 Thread Matt Sheppard
Looking for advice on how to be more "perlish" in this bit of code. The idea is to allow execution of a script without pathing in the $0 parameter: if ($0 =~ m/^\//) { exec("$0 @ARGV"); } else { exec("./$0 @ARGV"); } Thanks, M@ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org Fo

Re: Trimming Whitespace

2012-06-06 Thread Matt
> Shawn has already provided an answer, but I wanted to point out what > your regular expression (/^\s*$/) is doing. That expression is > matching any string that is empty or only contains whitespace. > HTH, Ken Thanks. So what happens when you try to 'push' an empty string to an array? I assume

Trimming Whitespace

2012-06-06 Thread Matt
Looking at some old code I wrote. my @listing; open(IN, list.txt) or die $!; while () { chomp; next if /^\s*$/; next if /^#/; push(@listing, $_); } close IN; I want to trim any new lines off end of data. chomp does that. I want to skip any lines that begin with # and next if /^#

Re: Perl HTTP Get

2012-05-30 Thread Matt
>> Thanks.  Yes, using Simple.  Looking at this. >> >> Can I do something as simple as this? >> >> $rststr = ""; >> alarm(60); # set timer for 60 seconds >> $rststr = get("http://"; . $dst . "/request.htm" ); # try to get my data >> alarm(0); # turn off timer > > More or less, yes--have you tried i

Re: Perl HTTP Get

2012-05-29 Thread Matt
>> I have a line like this: >> >> $rststr = get("http://"; . $dst . "/request.htm" ); >> >> Problem is that I have had this script hang due to the $dst site being >> down. Is there a way to do a time out? > > Consider using the core alarm() function, or using LWP::UserAgent (I'm > guessing you're

Perl HTTP Get

2012-05-27 Thread Matt
I have a line like this: $rststr = get("http://"; . $dst . "/request.htm" ); Problem is that I have had this script hang due to the $dst site being down. Is there a way to do a time out? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@p

Merging Files

2012-01-31 Thread Matt
Perhaps asking wrong place but I have two directories both full of hundreds of text files. dir1/file1 dir1/file2 dir2/file1 dir2/file2 I want to append all files together with same name into a new directory. dir1/file1 contains: hi by later dir2/file1 contains: woops dropped new_dir/file1 woul

Copying a Hash

2012-01-31 Thread Matt
When I copy a hash like so: my %hash2 = %hash1; Modifying hash2 seems to modify hash1. How do I make it so there both independent after being copied? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Sorting a String

2011-08-16 Thread Matt
I believe you can sort an array like so: sort @my_array; I need to sort a string though. I have $a_string that contains: 4565 line1 2345 line2 500 line3 etc. Obviously \n is at end of every line in the string. I need it sorted. How would I approach this? -- To unsubscribe, e-mail: beginner

Counting Word Occurances

2011-07-15 Thread Matt
I have a file with lines like so but the number of them is in the thousands instead of seven lines: blue red red red orange orange green I want it to count the occurances of each word it finds in the file. So output on this small file would be: blue (1) red (3) orange (2) green (1) The contents

Rounding Date/Time

2011-05-02 Thread Matt
Have a date: 2011-05-02-16:40:51 Using this to get it: $tm = gmtime; $time_stamp = sprintf "%04d-%02d-%02d-%02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec; print "$time_stamp\n"; I need to round it to nearest 5 minute point. 2011-05-02-16:40:51 needs

Re: Shorten String

2011-04-06 Thread Matt
>> You probably want something like: >> >>   substr $x, 10, -10, " ... " if length $x>  25; > > Very neat Paul. My hat's off to you. Worked perfectly too. Thanks Paul. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.

Shorten String

2011-04-05 Thread Matt
I am looking for a perl function or easy way to shorten a long string if its over X characters. Say I have: "Doe, John; 56943 Walnut Drive; SomeCity, NY" It messes up the display of my html form. So I would like it changed to: "Doe, John; . meCity, NY" Keep first 10 and last 10 characters

Re: Testing File Contents

2011-03-02 Thread Matt
> The easiest way in my opinion is to use the 'grep' function like this: > > my $searchstring="whatever"; > open CFG, '<', $_file || die("could not open file: $_file!"); > my @data=; > close CFG; > if ( grep /$searchstring/i, @data ) { >  print "$searchstring found\n"; > } > This sorta worked. Ne

Re: Testing File Contents

2011-03-02 Thread Matt
gger once if its no where in the file. > The other way would be on shell - > # Untested > grep my_string my_file > if [ $? -eq 1 ] > then >     echo "Do something" > fi > ~Parag > > > > On Wed, Mar 2, 2011 at 9:55 AM, Matt wrote: >> >&g

Testing File Contents

2011-03-02 Thread Matt
I am looking for a simple way to test if a file does not contain a string. This is on a linux box. if myfile does not contain mystring { #do_something; } The file is basically a list of names and I want to test that a certain name is not in there. Is there an easy way to do that? -- To un

Linux Uptime

2010-12-16 Thread Matt
I have a perl script but I want to exit it if the uptime on the server is less then say an hour. Any idea how I would get uptime with perl? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Array Question

2010-12-14 Thread Matt
I am assigning a number of elements to an array like so: my @new = `find /home/*/new -cmin 1 -type f`; That works fine. I would also like to append more lines to that array from here: find /home/*/filed -cmin 1 -type f How do I do that without losing whats in the array already? -- To unsubsc

pdf to spreadsheet advice

2010-09-06 Thread Matt Johnson
ed to. Thanks -- Matt -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Real newbie question

2010-07-21 Thread Matt
o Perl http://www.oreillyschool.com/courses/perl1/ Online Course, Pricy but very good. Tizag Tutorials http://www.tizag.com/ Free and pretty good. Matt -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: speed test

2009-12-04 Thread matt
On Dec 3, 6:56 am, shlo...@iglu.org.il (Shlomi Fish) wrote: > Hi matt! > > On Wednesday 02 Dec 2009 18:29:53 matt wrote: > > > > > On Dec 1, 8:58 pm, practicalp...@gmail.com wrote: > > > Hello, > > > > Maybe it's not so suitable to ask this her

Re: speed test

2009-12-03 Thread matt
On Dec 1, 8:58 pm, practicalp...@gmail.com wrote: > Hello, > > Maybe it's not so suitable to ask this here. > But is there a good way (code sample?) to implement a speed test > between Perl and C? > For a project which handles lots of data we want to know how slower > perl is than C. > > Thanks. T

Re: PRINT LAST ENTRY IN A FILE

2009-12-01 Thread matt
On Nov 28, 2:21 pm, paik...@googlemail.com (Dermot) wrote: > 2009/11/28 raphael() : > > > > >> 2009/11/28 raphael() : > >> > Hi, > >> Hi, > > >> > # records.txt > >> > 25.11.2009 NAME_0 > >> > 15.12.2006 NAME_3 > >> > 20.10.2007 NAME_1 > >> > 01.01.2008 NAME_3    <-- This whole

Re: How to redirect a message simultaneously to a file-handler and standard O/P

2009-11-18 Thread matt
On Nov 17, 12:32 pm, jimsgib...@gmail.com (Jim Gibson) wrote: > On 11/17/09 Tue  Nov 17, 2009  9:24 AM, "Parag Kalra" > scribbled: > > > Hi All, > > > I know this may be a very basic question but I don't know how to accomplish > > it. :( > > > I want to know how to redirect a message simultaneousl

Re: Regex to array woes

2009-11-03 Thread matt
+=2) { print "$h2ip[$i]\n"; } $ ./test.pl 10.203.4.5 10.203.4.7 Or, if you don't mind the longer regex and don't want to have to skip array indices: my $string = 'Haresources : 10.203.4.5, Interfaces : 10.203.4.5 10.203.4.7'; my @h2ip = ($string =~ m/(\d{1,3}\.\d{1,

Re: Perl projects for beginners

2009-09-07 Thread Matt Young
Hi Gabor. So far, in my quest to learn perl, it's been pretty easy to learn how to program basic applications, that perform simple functions using modules from CPAN. I think beginners would greatly benefit from learning how to write their OWN perl module to aid in performing a task. This would pr

Re: Optimize the script

2008-07-05 Thread matt
On Jul 4, 4:08 am, [EMAIL PROTECTED] (Jet Speed) wrote: > Hi All, > > I put togather a piece of code with some help, to capture the output as > below from a file "cxout1" as below. I am sure this can be written in few > lines or even differnt way of getting the same out put with use of hash etc. >

Re: Max range of rand function?

2008-07-03 Thread matt
On Jul 2, 10:04 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > howa wrote: > > On 7月2日, 下午11時59分, [EMAIL PROTECTED] (John W. Krahn) wrote: > >> howa wrote: > >>> Hi, > >> Hello, > > >>> I want to have a max range of rand function, so I use > >>> my $rnd = rand(4294967295) ; > >>> However, is it saf

Net::SSLeay

2007-12-06 Thread Matt Hudas
/local/02_pod_coverage..skipped all skipped: currently disabled t/local/03_use...ok t/local/04_basic.ok t/local/05_passwd_cb.ok t/local/06_tcpecho...Use of uninitialized value in string eq at t/local/06_tcpecho.t line 50. Thanks, Matt

Re: find2perl output to array

2007-06-19 Thread Matt
Rob Dixon wrote: Matt wrote: Thanks Martin, change following line: (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && /^DATA.*\.zip\z/s && print("$name\n"); to (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ &

Re: find2perl output to array

2007-06-19 Thread Matt
Martin Barth wrote: Hi Matt, I did that, and then at the bottom of the script I tried looping through just to verify that @files was populated - no dice. (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && /^DATA.*\.zip\z/s && push @files, nam

Re: find2perl output to array

2007-06-19 Thread Matt
,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && /^DATA.*\.zip\z/s && push @files, name; } for $element (@files) { print $element, "\n"; } What have I done wrong? Although if I put that for loop within the function it does populate,

find2perl output to array

2007-06-19 Thread Matt
,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && /^DATA.*\.zip\z/s && print("$name\n"); } Any help would be appreciated. Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: File::Find again

2007-03-25 Thread Matt Herzog
On Fri, Mar 23, 2007 at 03:09:31PM -0700, Wagner, David --- Senior Programmer Analyst --- WGO wrote: > > -Original Message- > > From: Matt Herzog [mailto:[EMAIL PROTECTED] > > Sent: Friday, March 23, 2007 15:00 > > To: Begin Perl > > Subject: File:

File::Find again

2007-03-23 Thread Matt Herzog
Hello All. I can see why people hate this module but I can't seem to let go. I point this script at a deep dir structure that has java .properties files sprinkled throughout it. Right now when I have my regex "hard coded" in the file, (.properties$) the search works fine. I need to be able to use

File::Find

2007-03-22 Thread Matt Herzog
Hey all. I'm trying to write a script that will append a few chars (example _fr) to the end of the "prefix" filename. All the filenames I need to change end with .properties. I need to have this script descend into all subdirs of the dir specified at the command line. I can't seem to understand h

parse for two regexes

2007-03-13 Thread Matt Herzog
Hi All. I'm trying to either strip everything outside the tags or match everything inside them for three nearly identical web pages. I need the content of the pages minus header/footer. Ultimately I need to glue them all together into one valid html doc but that's for later. In general, should

Re: Loop while socket connection exists

2007-03-09 Thread Matt
voluted solution I'm sure but I can't seem to find anything else. Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Loop while socket connection exists

2007-03-09 Thread Matt
Jeff Pang wrote: } else { my $whileloop = 99; } Hello, There is a scope mistaken above.You declare $whileloop at the outside of the loop,while here you re-declare another $whileloop with "my".This $whileloop is different from the former one.So "my $whileloop = 99" s

Re: Loop while socket connection exists

2007-03-09 Thread Matt
king though. If I put the server interfaces down, then of course it fails with the "Could not create socket: $!\n". However, if I start the script with the server interface active it starts to iterate through the loop. But if I then take the server interface down it still iterates through

$.:

2007-02-26 Thread Matt Herzog
What does $.: mean? -- Ubuntu eh? I'm not really into Pokemon. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

MIME::Lite

2007-02-20 Thread Matt Herzog
Hi All. I need some help with the below. The script works fine except that for most recipients or mailers/clients the strings of text so not alternate with the image files. In their mailers they see: Number of users logged-in for kaplanfinancial: Number of users logged-in for brun

mailing images from a url

2007-02-06 Thread Matt Herzog
w is a bunch of snippets that don't work togther. Thanks for any help! -- Matt -- No folly is more costly than the folly of intolerant idealism. whippy.pl Description: Perl program [EMAIL PROTECTED] ekolab heintz hubers saab armies [EMAIL PROTECTED] elmc ibem twitty textronz [EMA

Re: installing question

2007-01-09 Thread Matt
And this answers his question exactly how? Mathew Arvind Autar <[EMAIL PROTECTED]> wrote: gentoo is a bad distrobution you should remove it and install a sane distrobution. Yours truly 2007/1/9, Jorge Almeida : > > I just installed Perl from source. My distribution (gentoo linux) > supports

Re: test

2007-01-09 Thread Matt Richards
On Tue, 2007-01-09 at 18:45 +0800, Sayed, Irfan (Irfan) wrote: > test it works :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: test

2007-01-09 Thread Matt Richards
On Tue, 2007-01-09 at 18:45 +0800, Sayed, Irfan (Irfan) wrote: > test it works :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Free Perl Editor

2007-01-02 Thread Matt Richards
what do you use as your text editor then? OROSZI Balázs wrote: Emacs and Vim are both braindead. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Help with WWW::Mechanize

2006-11-30 Thread Matt Johnson
Mathew Snyder wrote: > Tom Phoenix wrote: >> On 11/28/06, Mathew Snyder <[EMAIL PROTECTED]> wrote: >> >>> I have a form I'm trying to fill out. One of the fields, despite >>> being named in >>> the HTML source keeps erroring out on me. >>> >>> fields => { >>> "ValueOfStatu

Re: How to manipulate environment variables in parent process?

2006-11-14 Thread Matt Johnson
siegfried wrote: >>> I think the best I could hope for would be to write a perl script that >>> generated a bat file and then I manually execute the bat file. I don't >>> think there is anyway to automate the execution of the bat file. >> I'm sure that there is; if you can't put it into its own bat

Re: compiling PERL programs

2006-08-13 Thread matt
. Matt. On Sun, 13 Aug 2006, hOURS wrote: Hi all, I'd be interested in compiling programs I write in PERL. This is possible, right? I see occasional mention of such here and there but can't seem to find information on how it might be done. I assume one would need appropriate softw

Re: How to use Perl for API testing

2006-07-10 Thread Matt Johnson
You might want to consider Test::WWW::Mechanize http://search.cpan.org/author/PETDANCE/Test-WWW- Mechanize-1.12/Mechanize.pm or WWW-Mechanize http://search.cpan.org/~petdance/WWW-Mechanize-1.18/ lib/WWW/Mechanize.pm -- MattJ On Jul 9, 2006, at 10:13 PM, Suja Emmanuel wrote: Hi,

Re: best way of getting a web document

2006-06-25 Thread Matt Johnson
manipulation in some cases. -- Matt Johnson -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: using hashes with request(POST

2006-04-16 Thread Matt Richards
Mr. Shawn H. Corey wrote: On Sat, 2006-15-04 at 22:30 +0100, Matt Richards wrote: hello everybody, :) i'm just starting with perl and i have come across a little problem that i cant seem to solve, atm i have this code ... my $response = $ua->request(POST $url, Content_Type =>

using hashes with request(POST

2006-04-15 Thread Matt Richards
hello everybody, :) i'm just starting with perl and i have come across a little problem that i cant seem to solve, atm i have this code ... my $response = $ua->request(POST $url, Content_Type => 'form-data', Content => my %fq_hash); i would like the hash values in $fq_hash to be submitted as

Re: User define switch

2006-02-20 Thread Matt Johnson
Andrej Kastrin wrote: > Dear all, > > Is there any simple way to add user defined switches in Perl. I want > someting like that: > > perl --filein MyInputFileName --fileout MyOutputFileName ##in command line > > With --filein switch I want to define file, which will be read as the > input and w

Time::localtime help

2005-05-16 Thread Matt Kopeck
like the name of the month(ex. 'May') displayed instead of 05. What is the easiest way to do this? Thanks, Matt DISCLAIMER* This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they ar

Re: regular expression matching vertical tab

2005-01-20 Thread Matt Matijevich
>ord() returns the _decimal_ number 13 (octal 015, hexadecimal x0D) which is >the CR (carriage return) character *NOT* the VT (vertical tab) character. Well, that would be my problem. Thank you -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

regular expression matching vertical tab

2005-01-20 Thread Matt Matijevich
I am having troubles matching the Vertical Tab character using regular expressions. I have a string, I have looped through every character in the string and printed out the value returned from ord(), and I get 13 for one of my chars. I have searched and apparently that is the vertical tab charact

Re: urlencode and uri_escape

2005-01-14 Thread Matt Howard
say that uri_encode is correct. I don't believe there's a way to get the uri_encode function to do that for you, but you can translate before or substitute after if you really need them to match. -- Matt Howard <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED

RE: another directory search, yet many subdirs

2004-02-16 Thread Matt Matijevich
under each of these suddirs, I need all the eml files deleted but there are thousands of them and the actual file name is "training 2001.eml" so my questions still remain, Can I have this search recursively down under all the pc subdir names? File::Find will do what you need. Google can

Re: Do not understand Hashes !

2003-09-05 Thread Matt Matijevich
I am only a Perl beginner myself (there is probably much better ways to do this) but I put this together, I did not use the $ARGV array but that should be easy to change, I also manually deleted blank lines and spaces from the input files so you might want to check for those when you are looping th

Re: help if than else statement

2003-09-04 Thread Matt Matijevich
try this: if (@ARGV[0] == "-q"){print "it worked\n";} else {print "it did not work\n";} -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Net::LDAP error

2003-06-20 Thread Matt Thoene
This error isn't too explanatory. Why isn't it exported? -- Regards, Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Simple perl program

2003-03-26 Thread Matt O'neill
works well now that great, I was wondering how could i get it to list the files from the subdirectories as well? maybe using the -d command ? cheers matt. "James Kipp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] . > > > Im now trying to list a directo

Re: Listing directory

2003-03-26 Thread Matt O'neill
uey > Hi guys, > > Need a perl CGI script that will print to a web page the > contents of a directory specified in the program. Basically > i need the perl program to simply call the unix "ls" > function, not sure how to encorporate this into my script > though

Listing directory

2003-03-25 Thread Matt O'neill
Hi guys, Need a perl CGI script that will print to a web page the contents of a directory specified in the program. Basically i need the perl program to simply call the unix "ls" function, not sure how to encorporate this into my script though, any ideas? Cheers matt. -- To unsu

Re: Simple perl program

2003-03-25 Thread Matt O'neill
t(); } } print "no\n"; Thanks for your help "R. Joseph Newton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Matt O'neill wrote: > > > Hi guys, > > > > I need a very simple command line perl program that takes two arguements, &g

Simple perl program

2003-03-25 Thread Matt O'neill
Hi guys, I need a very simple command line perl program that takes two arguements, the frist being a filename and the second being a word to be searched for in that file. Then I simply want the result to print "yes" if arg2 is found, or "no" if it is not. Thanks for your h

XML::Mini question

2003-01-03 Thread Matt
Hi, I'm using XML::Mini to parse and print the contents of an xml file. The xml file has one root tag "" and identcal children "" which has 2 attributes "id & name" and 6 children " , , " " Since their can be any number of "" tags in the xml document at any one time, however, at all times, the

multi line comments

2002-12-11 Thread Matt Simonsen
I believe there are no multi-line comments in Perl. Do any of you have a good hack to fake these? Thanks Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: query a ph nameserver plus backtick question

2002-12-02 Thread Matt Simonsen
me |") or die "couldn't fork" ; while () { do commands here; } Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Write hash of hashes to disk?

2002-11-15 Thread Matt Simonsen
ng this structure to disk in XML looping over all the keys and values. I could read that back in to a hash each time my script runs and update the hash, rewriting it to disk, but that would ding the elegance of my script and so I'm trying to avoid it. Suggestions would be greatly appreciated.

query string into hash?

2002-11-13 Thread Matt Simonsen
; #Here I could use a tip on how to split counting the encoding @words = split ($querys{q}) ; I have to do this for millions of lines per month so any tips to help me optimize this would be appreciated. Thanks Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Time CHange Regulatr expression for 2am Crons ?

2002-10-25 Thread Matt Simonsen
one was "2" Now this may not help you if you have something like */3 and it happens to run at 2:00 am, but this doesn't seem to be what you're looking for. Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Parse data file

2002-10-01 Thread Matt Simonsen
On Tue, 2002-10-01 at 05:34, Janek Schleicher wrote: > Matt Simonsen wrote at Tue, 01 Oct 2002 01:00:41 +0200: > > > I need to get 2 fields out of a file which has the following format: > > I put a real clip below ... should be more helpful. > What is the exact data you

Parse data file

2002-10-01 Thread Matt Simonsen
think they are the poorer of the many ways to do it. Any tips on how you'd elegantly separate the data would be appreciated. Thanks Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Preferred way to move and compress a file

2002-09-26 Thread Matt Simonsen
ll several hundred megs so I want to be sure to do it right. Thanks Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: head as in "unix"

2002-09-18 Thread Matt Simonsen
You could write your own function that is a for loop that counts until 100, putting each line into the array and quits would work. There may be a more elegant way, though... Matt On Wed, 2002-09-18 at 09:31, Jakob Kofoed wrote: > > Hi there, > > Does Perl have a function like t

RE: IDE's

2002-08-22 Thread Matt Wetherill
Not an IDE, but I use EditPlus 2 which has nice (IMHO) syntax display and allows you to run code and pipe the output to its own window with a single button press. Matt - ** Matt Wetherill University of Salford [EMAIL PROTECTED] mobile: +44 7812 016059 office: +44 161

RE: comparing file dates from different servers

2002-08-20 Thread Matt Wasserman
Not for nothing, and I am no expert, but you have a space between c and $ in your $destFile variable... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 9:56 AM To: [EMAIL PROTECTED] Subject: comparing file dates from different servers

Best way to split log

2002-08-20 Thread Matt Simonsen
ot;Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)" - www.careercast.com In other words I want hash[0] = 1.2.3.4 hash[1] = - hash[2] = - hash[3] = 15/Aug/2002:06:43:39 -0700 hash[4] = 200 hash[...] hash[10] = www.careercast.com Thanks Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Best way to split log

2002-08-19 Thread Matt Simonsen
ot;Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)" - www.careercast.com In other words I want hash[0] = 1.2.3.4 hash[1] = - hash[2] = - hash[3] = 15/Aug/2002:06:43:39 -0700 hash[4] = 200 hash[...] hash[10] = www.careercast.com Thanks Matt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

CGI script problem

2002-08-19 Thread Matt Wetherill
etscape6 works fine and displays the environment in the browser window, but IE 6 tries to download the script and it looks like the server isn't being allowed to run it. I appreciate that this is probably a bit off-topic, but any advice or pointers to other resources would be greatly appreciate

Regular expressions

2002-07-19 Thread Matt Wetherill
pression could do all this, but I'm struggling - any ideas would be greatly appreciated. regards Matt - ** Matt Wetherill University of Salford [EMAIL PROTECTED] mobile: +44 7812 016059 office: +44 161 295 5853 ** --- Outgoing mail is certifi

Script advice

2002-07-19 Thread Matt Wetherill
# Finish sending mail $smtp->quit; # Close SMTP connection However, this script just mails the whole file - what I'd really like to do is just mail the current days entries, but this is defeating me! many thanks advance Matt - ***

RE: Mail::Mailer

2002-07-19 Thread Matt Wetherill
Net::SMTP works for me (although I use the activestate perl package manager, which makes things easy :) regards Matt > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: 19 July 2002 09:02 > To: [EMAIL PROTECTED] > Subject: Mail::Mailer &g

Re: perl graphics editing

2002-07-18 Thread Matt Simonsen
This isn't a Perl solution (unless you run it from a perl script...) but it'll work. Use mogrify, part of the imagemagic software suite one command will do the whole trick. Matt On Thu, 2002-07-18 at 11:56, David Gerler wrote: > Hi, > I have searched cpan using p

RE: Can get script to print to command prompt no matter what I try

2002-07-17 Thread Matt Wetherill
pt by typing its name (with extension). You could also specify the full path to the script from the command prompt - i.e. c:\MyPerl\example.pl hth Matt - ** Matt Wetherill University of Salford [EMAIL PROTECTED] mobile: +44 7812 016059 office: +44 161 295 5853

Re: How to get single scalar to function cleanly

2002-05-21 Thread Matt Simonsen
On Tuesday 21 May 2002 17:01, Eric Beaudoin wrote: > You can pass more than one parameter to ParseDate. > > my $date = ParseDate(@secureFields[0..2]) > Doh! Yes, that's exactly what I want. I was trying @secureFields[1-3] - my obvious (now) mistake was not using the .. T

  1   2   3   >