Re: HTML::TableExtract

2002-02-20 Thread Andrea Holstein
In article <042101c1b9d4$aa61b560$0701a8c0@KOLD> wrote "Kevin Old" <[EMAIL PROTECTED]>: > ... > foreach $a (@headers){ > > SWITCH: { > > if($a =~ qw/sorry/) { $sorry = 1; last SWITCH; } > if($a =~ qw/kevin/) { $kevin = 1; last SWITCH; } >

Re: qw for variables?

2002-02-19 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Dennis G. Wicks" <[EMAIL PROTECTED]>: > Greetings; > > I can get qw to work for things like > > @n = qw( john jacob jingleheimer schmidt ); > > but something like > > @n = qw( $names ); > > doesn't work. I get the literal string "$names"

Re: Printing data into a file every time some presses

2002-02-18 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Bruce Ambraal" <[EMAIL PROTECTED]>: > Hi > > Could someone help? > > the following code is not working. What's wrong ? What's the error message ? > > open(INPUT_FILE,"+>fixed.dat") || die "Could not open filename"; In this snippet INPUT_FILE is a file wh

Re: OLE DB

2002-02-18 Thread Andrea Holstein
In article <000f01c1b8b8$61d7a420$f389933e@w3w6d9> wrote "Mb" <[EMAIL PROTECTED]>: > Hello all, > I have seached for learning OLE DB syntax for accessing database,and all >informations converge > to this statement for join use but it does not work. I regret, that's not an SQL list. > req

Re: References/unitialized variable error message

2002-02-17 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Geoffrey F. Green" <[EMAIL PROTECTED]>: > #!/usr/bin/perl -w > > my %table = ( > "key1" => > {search=> "alpha", > shortname=> "beta", > }, > "key2" => > {

Re: SPLIT

2002-02-16 Thread Andrea Holstein
In article <002501c1b66e$b8594340$cbfea8c0@agustinr> wrote "Agustin Rivera" <[EMAIL PROTECTED]>: > How would I keep the character (or characters) that I am splitting by? > > for example, > > @tags=split(/>/, $line); > > I would like to keep the ">". > print join("\n",split /(?=\>)/, "1>2>3>"

Re: arrays and refs...argh!

2002-02-16 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Ron Goral" <[EMAIL PROTECTED]>: > Can someone please tell me why the following code only returns the last element in >the referenced > array? If I put the foreach routine inside the while loop, I get a printout of each >element in > both the $sqlRes refer

Re: Difference between \[^x]*[^a]*

2002-02-16 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Eric Beaudoin" <[EMAIL PROTECTED]>: > At 22:56 2002.02.15, Jim Witte wrote: >> What is the difference between \[^x]*[^a]*cleaning up a >> webpage, trying to find paragraph tags followed by list-item tags (some of which >had a space >> inside the tag), wit

Re: urgent gettting '$var' as a String 'value of $var'

2002-02-16 Thread Andrea Holstein
In article <01c1b6e3$01433e20$62a3933e@w3w6d9> wrote "Mb" <[EMAIL PROTECTED]>: > Sure i m the only one doing perl in the week-end, the mailinglist is deserted. :-) > > I' m tryig to generate dynamic SQL statements. > I have a problem on getting a WHERE over 'varchar' type fields. I don'

Re: printing "\n" automagically?

2002-02-15 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Dennis G. Wicks" <[EMAIL PROTECTED]>: > Greetings; > > Is there any easy way to get print to do a "\n" without coding it explicitly? > > Most of the code fragments posted don't have any line feeds in the print statements >and without > them the output gets

Re: multiple __DATA__ entries possible?

2002-02-15 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Zentara" <[EMAIL PROTECTED]>: > Is it possible to have multiple __DATA__ > entries in a program. I can seem to find > a way to end __DATA__, and @array is > getting everything. How to I end __DATA__? > > > Like: > > @array = ; > @array1 = ; > > __DATA_

Re: More string manipulation

2002-02-15 Thread Andrea Holstein
In article <00bb01c1b645$0b8eef80$[EMAIL PROTECTED]> wrote "Brian Johnson" <[EMAIL PROTECTED]>: > I have the following code that I need a little advice on. It'e easier for us all, if you short describe your problem. I assume that the following contains some errors, you can't find. > > The $re

Re: Urgent - Getting the left most 3 characters from a string...

2002-02-15 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Chris" <[EMAIL PROTECTED]>: >> ... > Thanks! > > ... > my $newresult = $result; > print "New Results - $$newresult\n"; > my $resultcode; > print "Result Code - $$resultcode;\n"; > if ($newresult = 200) { Take Care: You surely meant

Re: String manipulation help needed

2002-02-15 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Brett W. McCoy" <[EMAIL PROTECTED]>: > On Thu, 14 Feb 2002, Brian Johnson wrote: > >> I need a string in the form >> Wed, 18 Jul 2001 14:20 >> >> Of course my line doesn't quite cut it. >> my $emaildate = join " ", $record->{day}, $record->{month}, >>

Re: array references

2002-02-13 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Jon Serra" <[EMAIL PROTECTED]>: > Greetings, > > I have an array, each element will contain a reference to another array. How > can I dynamically generate each of those references such that each reference is >unique. I am > trying to create dynamic

Re: finding max value

2002-02-13 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Jeff 'Japhy' Pinyan" <[EMAIL PROTECTED]>: >>I have a set of functions that give numeric results, and I need to compare them and >choose the >>maximal value. Is there any simple way of finding max? > > Go through them one at a time, and keep track of the l

Re: Anonymous hash question

2002-02-12 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Nikola Janceski" <[EMAIL PROTECTED]>: > I am using a module function (method) that requires an anonymous hash as the first >parameter. > > ie. $sender->OpenMultipart({from => $FORM{'from'}, to => $FORM{'to'}, cc => >$FORM{'cc'}, >s

Re: Reading Multiple lines

2002-02-12 Thread Andrea Holstein
In article <057501c1b305$6a15b360$[EMAIL PROTECTED]> wrote "J. Raj Mohan" <[EMAIL PROTECTED]>: > Hi Andrea, > > Thanks for responding my mail. > > Actually I want to read(store it into a string) like; Begin keyword is "and the End > keyword is ">". By using these two delimiters I like/want to r

Re: Why won't while die? + Accessing the filename of a opened file

2002-02-12 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Michael Fowler" <[EMAIL PROTECTED]>: >> ... >> > if(open(FILE1, "/Users/tor/Perl/test")) { >> >> On a *nix system I would never give a file or a script the name test. test is a >system command on >> unix and >> if the

Re: getting a block of text from file

2002-02-12 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Chris Zampese" <[EMAIL PROTECTED]>: > Hi All, > I have a file that contains the contents of an email. Its format is shown below... > > (Lots of lines of random stuff) > Content-Transfer-Encoding: quoted-printable > > The message of the email is here the

Re: is false self-evident? [was Re: Perl trainer requests beginner help]

2002-02-11 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Michael R. Wolf" <[EMAIL PROTECTED]>: > > If not, I re-assert that there are 4 false values and that every thing else is true. > "" > "0" > 0 > undef > It's not simple anyway. 0.0 is a false value, too, while "0.0" is true value :-) Same

Re: Reading Multiple lies

2002-02-11 Thread Andrea Holstein
In article <014701c1b2d1$38e62380$[EMAIL PROTECTED]> wrote "Raj Mohan" <[EMAIL PROTECTED]>: > Hi All, > > Is that anybody can help me to find a solution for the blow:- > > I have a file like this:- ... > Seems that you need everything from the file except the first line. What you need, need

Re: Why won't while die? + Accessing the filename of a opened file

2002-02-11 Thread Andrea Holstein
In article wrote "Dr-Nikon" <[EMAIL PROTECTED]>: > [localhost:~/Perl] tor% cat test > this is line nr 1 > this is line nr 2 > etc.. > .. > this is the last line in the file > > [localhost:~/Perl] tor% cat 23.pl > #!/usr/bin/perl > > if(open(FILE1, "/Users/tor/Perl/test")) {

Re: Im really new to perl....

2002-02-11 Thread Andrea Holstein
In article <003301c1b339$e9e9b580$[EMAIL PROTECTED]> wrote "Kliment Ognianov" <[EMAIL PROTECTED]>: >> Ok im really new and was wondering what the -w meant after the #!/usr/bin/perl line. >> >> Thanks. >> >> > In older versions of Perl there's a module called warnings..this is the same. It

Re: is false self-evident? [was Re: Perl trainer requests beginner help]

2002-02-03 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "John W. Krahn" <[EMAIL PROTECTED]>: > print q("0e0" is ), "0e0" ? "TRUE" : "FALSE"; > print q( 0e0 is ), 0e0 ? "TRUE" : "FALSE"; > ' > "0e0" is TRUE > 0e0 is FALSE Even without floats, there's a curious behaviour: > print q("00" is ), "00" ? "TRUE" : "FA

RE: quick sort --help me

2002-02-03 Thread Andrea Holstein
In article <2E4528861499D41199D200A0C9B15BC031B7E8@FRISTX> wrote "Bob Showalter" <[EMAIL PROTECTED]>: > Note that the assignment is seen as a term in the list supplied to print, so it will >be executed > *before* the prompt is printed. To make the comma into a sequence operator, you >need to ad

Re: quick sort --help me

2002-02-02 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Sanilkumar" <[EMAIL PROTECTED]>: > this program is not working please help me Sorry, I couldn't find the error instantly. But perhaps I can help you to improve your programming style. 1. Give your variables names that explain themselves. Readability co

Re: files

2002-02-02 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "P0r0ng" <[EMAIL PROTECTED]>: > hi list. > supposing i have a directory containing these files: nat_10-full.xml.afp >nat_10.xml.afp > nat_1-full.xml.afpnat_1.xml.afp > nat_2-full.xmlnat_2.xml > nat_3-full.xmlnat_3.xm

Re: Mucking around in txt with arrays

2002-02-02 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Steven Rubin" <[EMAIL PROTECTED]>: > I'm a newbie, I just finished the Visual Quickstart Guide. I want to know, can >anyone give me an > out line of how I'd do this: Create a script that formats a txt file into html. >Well, that's > kinda vague. I mean..

Re: remove spaces before and after . . . howdoi?

2002-01-09 Thread Andrea Holstein
Booher Timothy B 1stlt Afrl/Mnac wrote: > o.k. my program finally works (thanks for the help yesterday) . . . but I am > convinced I am doing this the long way . . . I am sure there is a more > elegant solution (prob a one-liner). Any thoughts . . . > #!/usr/bin/perl -w > # This program is just t

Re: file name matching

2002-01-09 Thread Andrea Holstein
Scott wrote: > > Morning: > > I need to scan a directory for files, they will be in pairs, a .tag file > and a .txt file. I need to first make sure the .tag file(s) is there. If > it is I need to check for the same prefix .txt file. Here is what I do to > check for the file: > > ($scantag) =

Re: hiding file data

2002-01-09 Thread Andrea Holstein
Stuart Alexander wrote: > > Hi All, > > I have a few perl files that I need to send out to a client. However, we do > not want them seeing what are in the files for obvious reason. Is there any > way that I can hide the info in the files, or should I creat an executable. If you're afraid that y

Re: add 3 months

2002-01-09 Thread Andrea Holstein
Mark Frater wrote: > > I'm missing something.. > > use Date::Manip; > $paidto ="Mon May 19 23:00:00 2003 NZST"; > $newpaid = &DateCalc($paidto,"+3 month",\$err); > print "paidto =$paidto\n"; > print "newpaid = $newpaid\n"; > > output > paidto =Mon May 19 23:00:00 2003 NZST > newpaid = I swit

Re: how to change directory in AIX in Perl ?

2002-01-08 Thread Andrea Holstein
Families Laws wrote: > > I tried to do a change directory and then do a tar of > the directory: > > My program: > > system("cd /usr/apps"); Like Jeff told, use the chdir function (perldoc -f chdir) > You should always check the return value of the system command. Note that return 0 is O

Re: 'my' for each loop or no ?

2002-01-08 Thread Andrea Holstein
Prahlad Vaidyanathan wrote: > > Was wondering which of these 2 pieces of code is more efficient : > > > my $file ; > foreach $file (@tarred) { #do something ; } > foreach $file (@gzipped) { #do something else ; } > > > OR > > > foreach my $file (@tarred) { #do someth

Re: Newbie - #include virtual in my .SHTML file just displays the contents of the CGI

2001-12-31 Thread Andrea Holstein
Dale W wrote: > > If I run the script from my browser, it works great. When I call the CGI > file from my SHTML file, it just dumps all of the text from the CGI file > into the brower. Here is a simple example: > > -MY.SHTML > I don't know something about "virtual" scripts. However, >

Re: child processes and environment variables

2001-12-29 Thread Andrea Holstein
Thomas Maciejewski wrote: > > -- > This message is intended only for the personal and confidential use of the >designated recipient(s) named above. If you are not the intended recipient of this >message you are hereby

Re: Hello. How can I fix this line of code?

2001-12-28 Thread Andrea Holstein
[EMAIL PROTECTED] wrote: > Hi, there. I am a perl newbie. I just was curious how I can convert this: > $q -> start_form({action => $q -> url()}) . > > (Where url = www.domain.com) > > to turn url into > www.domain.com/form.htm > > I don't know how to edit that line to do it > > Just figured I'd

Re: Hash question

2001-12-28 Thread Andrea Holstein
Wim De Hul wrote: > > Hashes are hard to understand (regarding on the questions in this > list...). I have also a question: > Why doesn't this work? I get a synthax error? > > foreach $index (sort keys %IfType{$router}) { > print " Interface: $IfType{$router}{$index

Re: substitution

2001-12-27 Thread Andrea Holstein
Frank McCollum schrieb: > > related question: I want to strip out any '*' symbols as well, and replace > them with a zero. So, I changed my code to reflect: > > $origFee =~ s/[%\*]/0/; > Of course, the best is what John W. Krahn has shown: $origFee =~ tr/*%/0/d; But your idea is possible, to

Re: Question,

2001-12-27 Thread Andrea Holstein
Dan Hoggard wrote: > >Can anyone help me. > > I'm tring to include a view all members and delete member option in the > admin area for this script. > I have it going to a flat file, here. > open (FILE, ">>$cgiroot/data/address/members.txt"); > > How do I call it from this area and include

Re: searching through httpd.conf

2001-12-27 Thread Andrea Holstein
Tyler Longren wrote: > > ... > I need to get whatever the ServerName is. Here's what I have: > open(APACHE_CONF, "/usr/local/apache/conf/httpd.conf") or die "Could not > open Apache config file:\n$!\n"; > my @servernames; > while() { > push (@servernames, $1) > if/ServerName\swww..(.*)/;

Re: Indexing through Array of Arrays

2001-12-25 Thread Andrea Holstein
Kurt wrote: > > I'm working with a database interface (DBI) that returns information > by returning a reference ($Z) to an array of arrays. > > ... > > When I write $Z->[2][3] I get the expected -81.3439. > > Now the questions: > > If I want to iterate over each of these elements, to print ou

Re: how to construct regexes so that it do not match null

2001-12-22 Thread Andrea Holstein
Leon wrote: > > ... > > \b stands for a word boundary and has a length of 0. > > (4) Is this boundary \b equivalent to an empty string? What is the meaning > of 0 length? Is 0 lenght = empty string? No. Imagine how a regexp machine works. Simplified there is a pointer which directs to the chara

Re: Regexp question...

2001-12-22 Thread Andrea Holstein
"John W. Krahn" schrieb: > > Andrea Holstein wrote: > > > > A matching always return a list of the captured items. > > On the left side of the assignment is a scalar, > > so list in a scalar context returns its size. > ^^^

Re: Regexp question...

2001-12-21 Thread Andrea Holstein
Wim De Hul wrote: > > Hey folks, > > I'm writen a script to manage my router configuration. > To get the IOS version I use regular expressions. > First, I did it with: > > $_ = &getparameter($sysdescr_mib,"System description");# Get > the SysDescr via SNMP > /Version /; >

Re: how to construct regexes so that it do not match null

2001-12-21 Thread Andrea Holstein
Leon wrote: > > Without using $key == $cid, > How to construct a pattern so that $key match $cid. > I do not understand why in the undermentioned script, $key match $cid. > All explanations would be very much appreciated. > Thanks > > use strict; > my $cid = ''; > my $key = '1234'; > if ($key=~/

Re: STDIN

2001-12-21 Thread Andrea Holstein
Walter Valenti wrote: > > Hi, > someone knows, how insert text gron STDIN, without see this on the > shell?? > > For example for insert a password.. > > Thanks For reading a password, there's a CPAN module: Term::ReadPassword. Greetings, Andrea -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: Searching a string?

2001-12-21 Thread Andrea Holstein
TMTWTDI, here's my way: sub check_pass { local $_ = shift; # I assume a sub with one argument the password > > I am new here. But I need to ask what I hope is a relatively easy question. > I am writing a script that checks a password that someone enters. I have > what can be allowed in th

Re: resetting foreach loops and @lists

2001-12-21 Thread Andrea Holstein
James Lum wrote: > ... > a sample of my code looks like: > > foreach $zrec (@file) # file with agent and city > { chomp($zrec); >foreach $zkey (@template) # put agent city data into hash >{ $hash{$zkey},$zrec)=split(/\//,$zrec,2); >} >foreach $zrec2 (@list)

Re: Finding Data Length

2001-12-21 Thread Andrea Holstein
Prabhu Gurumurthy wrote: > > Hi All, > > I have a C program which i want to convert it into perl > In the C program it is given like this > > typedef unsigned short u_int16; > #define dataLen 4 > #define keyLen 52 > #define userkeyLen 8 > #define DataT(v) u_int1

Re: Replace

2001-12-20 Thread Andrea Holstein
Shawn wrote: > > > If speed is important, it's good to avoid capturing. > > so $string =~ s/(\w+)_(?:NN|IN|AT)/$1/g; is quicker. > > Is there a big time savings since there is a capture anyway? > It can't be said in generally. It depends on the input and the perl version. But at least, it's alw

Re: browser commands....

2001-12-20 Thread Andrea Holstein
Mark McLogan wrote: > > Hi! again. > > As I can insert browser commands in script in Perl. For example, if I want > to return to my previous web page (back) > > Thanks all! Sorry, but what's your question ? I only can find two statements. Did you mean, you want user's browser to go back to the

Re: Replace

2001-12-20 Thread Andrea Holstein
Shawn wrote: > > I think this is what you are asking for... > > $string=s/(\w+)_(NN|IN|AT)/$1/g; > $string=''.$string.''; > > Shawn I believe, there's a typo :-) $string =~ s/(\w+)_(NN|IN|AT)/$1/g; ^ If speed is important, it's good to avoid capturing. so $string =~ s/(\w+)_(?:NN|IN|

Re: How can I optimize the script for reading big files?

2001-12-19 Thread Andrea Holstein
Jenda Krynicky wrote: > > > How can I optimize the script for a big files ? > > > > > > Change it to : > > open(READ, "$ARGV[0]"); > open(WRITE,"> $ARGV[1]"); > > while(defined($i = )) { > $i =~ s/\.Cure/\.fa/g ; > $i =~ s/cure-/fa-/g ; > $i =~ s/class=Cure/clas

Re: Hash question...

2001-12-17 Thread Andrea Holstein
Ahmed Moustafa wrote: > > Hi Dan, > > Try this: > > # -- > %flags=(); > foreach $user ( keys (%popusers) ) { > if (-e "/home/$user/test.pl") { > $flags{$user} = "YES"; > } else { > $flags{$user} = "NO"; > } > } > # -- > Or quite a little

Re: Password form

2001-12-13 Thread Andrea Holstein
Ryan Guy wrote: > > I guess I was a little harsh. I just had a very bad night and I guess I > took it out a little on you. Sorry. You werent any of the things that I > said. I understand your viewpoint. Just wanted to apologize. No hard > feelings? Of course not :-) Thanks to Etienne. He

Re: Password form

2001-12-13 Thread Andrea Holstein
Ryan Guy wrote: > > Actually, Andrea, if that is your real name, his question was more than > detailed enough. Although I may not currently possess the information that > he is looking for I can still spot a thoroughly precise question. > Apparently you can not. Maybe you should work on that be

Re: please take a look

2001-12-13 Thread Andrea Holstein
Klaas schrieb: > I'm a real beginner. > I made a little program to copy files to an other folder (see below) > > # Remote resetten van ColdFusion server > > $interval=5; > while (l) { > sleep ($interval - time() % $interval ); > if (-r 'c:\reset\spool\cfreset.bat') { >

Re: fun with regex/split

2001-12-13 Thread Andrea Holstein
Pete Emerson wrote: > > I'd appreciate it if someone could help me wrap my brain around this one. > I've got a string like this: > $string='"one two" three "four five six"'; > > I'd like to wind up with an array like this: > one two > three > four five six > > Essentially, I would like to split

Re: Deleting lines of a file

2001-12-13 Thread Andrea Holstein
Mark McLogan wrote: > > Hi every body > I want delete some lines of a file > I desire to erase the lines that contain the word " home " since I can > make to eliminate these lines in the text if I have this word content in a > variable $var Who has the luck to use a real OS, not a baby tool :-

Re: Password form

2001-12-13 Thread Andrea Holstein
Juan Manuel Espinoza wrote: > > Hi everybody! > > How can i do a file that process a password form. > and if the pass is correct open a URL. > Sorry, but your description is not detailed enough. What kind of password form ? - shell - password window by tk - remote access like telnet - browser

Re: regexp extraction

2001-12-12 Thread Andrea Holstein
Birgit Kellner wrote: > > I have an html file and would like to extract image file names and > extensions: > > my $content = qq| > aölkjd oiae lkajf lksjfkjs df src="http://wlaskjfd.sdlkj/sdlk/LKJ_slkdjf_lkdjfslkj.gif";>|; > > Image file names may contain numers, letters or underscores. > > my

Re: read backwards

2001-12-12 Thread Andrea Holstein
[EMAIL PROTECTED]: > > Hi, > > I have an ASCII file, running in DOS. > It is not a fixed file length. > Its lines of data have various lengths. (some lines are empty). > > The program reads line by line(), and processes the lines. > At a certain line I need to read the next line, > check what i

Creating Exe-Files from a Unix-System

2001-12-11 Thread Andrea Holstein
Hi! I have to create an executable file from my perl scripts for Windows. I know, perl2exe is the standard way. But perl2exe can't create exe files for Windows 9x on a Linux/Unix-System. I neither want to buy Windows nor want to spend time to install it. Has anyone a hint how to create exe file

Re: Sending automatic email to list of addresses

2001-12-11 Thread Andrea Holstein
Tom Harmon wrote: > > I have a script that sends an email to a predefined recipient when a database is > updated. I would like to find out how I might convert this so it will open a list >file of > email addresses and send a copy to each address in the file. > > Currently, my script looks like

Re: Replacing column with constant

2001-12-11 Thread Andrea Holstein
Krister Sandberg wrote: > > Hi, > > I would like to replace a column in a file with a prespecified constant > say, 31. > > How should I do this? > > /Krister How is your file structured ? What have you already tried ? I assume that between two columns is a tab. I assume also that your file c

Re: Printing a text file

2001-12-11 Thread Andrea Holstein
Ben Crane wrote: > > Hi list, > > Does anyone know how to print out a text file to a > printer? i would like the option of chosing a printer > to send the document to, in addition, will I need to > reformat the text, or will it print out the text file > as is? > Have searched in search.cpan.org

Re: Capturing Output from a program

2001-11-29 Thread Andrea Holstein
Andrew Tait wrote: > > Hi All, > > At the moment I am using the system() fuctions to run external commands as > follows: > > print "Run \"userdel -r $arg\" [y/N] "; > chop ($answer=); > if ($answer =~ /^y/i) { > print "Deleting account"; > system("userdel -r $arg"); >

Re: First Program ever

2001-11-29 Thread Andrea Holstein
Shane Garza schrieb: > > Not just in perl this is my first program ever. > > I decided to look at perl first while immersed in awe. > > I am posting this code for feedback "and hopefully some positive feedback is > there", I just want to learn ;). So flame away, and try to create the same > lo

Re: floating point arithmetic

2001-11-29 Thread Andrea Holstein
Sidharth Malhotra wrote: > I encountered a problem with floating point arithmetic that I'm afraid > may be causing greater calculation errors in my program. The program > I'm writing calculates numerical solutions for ordinary differential > equations (http://sid.cwru.edu/perl/euler.pl). What's

Re: help on how to construct very specific matches

2001-11-29 Thread Andrea Holstein
Leon wrote: > need members help on this :- > > I wish to substitute ALL the number 123 marked in red found within the brackets ( >123 of 123 ), of $a, into 789. > > The regexes must not substitute the 4 following match :- > 123 ) > 123 > of 123 ) > 123 of 123 ) > > Therefore, the regexes MUST ONL

Re: Has modul an error ?

2001-11-27 Thread Andrea Holstein
Hi Martin! I don't understand the warning, too. But there are some little things, which could, but needn't be a problem Martin Pfeffer wrote: > use DBI; > my $dir = "/Webserver/www.xxx.at/martin/cgi-bin/test/"; > my $dbh = DBI -> connect("DBI:CSV:") || die "$1 --- $DBI::errstr";

Re: Basic Question on %ENV

2001-11-26 Thread Andrea Holstein
[EMAIL PROTECTED] wrote: > > Here is a basic question on %ENV hash. I gave a pronto statement as thus: > > perl -e "print $ENV{ComputerName};" > > and it printed the correct information. > > On my MS-DOS prompt when I gave the SET command, I noticed that the > environmental variable for Comput

Re: File System Sizes....

2001-11-26 Thread Andrea Holstein
James Kelty wrote: > > Hello! > > I am new to the list, so forgive me if this is not the correct forum. I am > writing (attempting to anyway) a script that will look at the size of the > filesystem, and warn me if it is getting too full, say 90% percent or so. > > Initially I though that combin

Re: Please answer my FAQ :) + a little enigma

2001-11-26 Thread Andrea Holstein
Etienne Marcotte schrieb: > > use strict; > > my $fd = "/foo/bar"; > > open (DIR, $fd) or die "Can't open directory: $!"; > readdir(DIR); > close(DIR); > splice(@_,0,2); #remove . and .. > foreach(@_) { > open(FILE, $fd/$_); > while () { > $_ =~ tr/KARMA1N3/N3V3RL4ND/g; # replace all KA

Re: Basic Questions

2001-11-26 Thread Andrea Holstein
[EMAIL PROTECTED] wrote: > > # > #!/usr/bin/perl > use strict; > # IF I do not assign {}, nothing is printed > my($hash) = {}; > &getArray($hash); > > # IF I do not engulf array-ref within {} as @{$hash->{array}} > # an er

Re: Sorting a list of links by the linked text

2001-11-24 Thread Andrea Holstein
Patrick Hall wrote: > > http://www.ocf.berkeley.edu/";>nutz0 > http://mundissa.com/";>cronópios > http://feralliving.blogspot.com";>feral living > http://underwatergirl.blogspot.com";>so blue it's black > http://genehack.org/index.html";>genehack > > Etc, just a big list of links. > > I'd like

Re: pattern matching

2001-11-18 Thread Andrea Holstein
Prasanthi Tenneti wrote: > > Iam a beginner in perl.I have one question, > Iam trying to write one prog,in which i have to search for one word in a > file, > If I found that word,print next 4 lines. > PLs help me,how to write code. open FILE, ") { print(,,,), last if /your_word/; } close

Re: NT - piping input to my perl script

2001-11-17 Thread Andrea Holstein
Daniel Murphy schrieb: > > OK, I've been lurking long enough. Got what I think is a very simple > question which may be more of an NT command shell question as it is a Perl > question. > > I have a very simple script (below) which reads data from STDIN and converts > the supposed EBCDIC hex data

Re: capture song title

2001-11-17 Thread Andrea Holstein
Ken Clark wrote: > > I want to capture the title of the current song I have running on my box > through mpg123 and redirect it to a file. In this process, I don't want > the /long/path/to/song but just the song.mp3. Is it possible to capture > the song title this way? > Hi, another way is: my (

Re: capture strings with two non-identical capital letters in a row

2001-11-17 Thread Andrea Holstein
> > my $string1 = "ABCD"; > my $string2 = "AbCd"; > my $string3 = "AABcD"; > > Get $string1, discard $string2 and $string2. > > ... > but ABBC displays as valid! > > Wags ;) What's the difference between "AABcD" and "ABBC" ?! However, I wrote a little script with two different poss

Re: Day of the month

2001-11-16 Thread Andrea Holstein
Glenn Cannon wrote: > > Thx japhy, > > Does exactly what I need it to. > > Now all I need is a way to work out the last day of the month. Most of them > should be easy, but that damn February... > It's always the best using an already existing module. E.g. Date::Calc: use Date::Calc qw(Days_

Re: What is "bubble sort"?

2001-11-16 Thread Andrea Holstein
"John W. Krahn" wrote: > That looks like a direct translation of algorithm 5.2.2B from TAoCP Vol. > 3 however the usual implementation is more like Sedgewick's example: > > sub bubble { > my $a = shift; > > for ( my $i = @$a; $i >= 1; $i-- ) { > for ( my $j = 2; $j <= $i; $j++ )

Re: sub-routine help needed.

2001-11-16 Thread Andrea Holstein
"Merrychristmas!" wrote: > > 1.@array = qw ( hello world hello how are you ); > 2.$match = 'HEllo'; > 3.print "Your search for $match returns $subroutine $count > records\n"; > > $subroutine = &count; > sub count { > foreach $record (@array){ > if (grep /$ma

Re: Array References - Concatenation

2001-11-15 Thread Andrea Holstein
Andrea Holstein wrote: > > TMTOWTDI: > > @joined_array = map { [ @$array1[$_], @$array2[$_] ] } (0..$#array1); > Please excuse my little bugs: I wrote a little script that helps to understand: Hallo! use strict; my $array1 = [

Re: How to pass two hashes to a sub

2001-11-15 Thread Andrea Holstein
Chuck Tomasi wrote: > > I'd like to send two or more associative arrays (hashes) to a sub. It looks > like the first one makes it but the values of the second never get passed. > Am I doing something wrong or is there a better way to do this (I'm hoping > you don't say by reference or I'll have

Re: Array References - Concatenation

2001-11-15 Thread Andrea Holstein
[EMAIL PROTECTED] wrote: > > Friends, > > I have two, two-dimensional array references, and I need to join the rows of > each array. > > $array1 = [ > [11,12], > [21,22], > [31,32] > ]; > and > $array2 = [

Re: Date manipulation (Back to the future)

2001-11-15 Thread Andrea Holstein
Suru Dissanayake wrote: > > Hi Perl mailing list! > > I have a small dilemma; I want to manipulate a date. > For example if I have the date ? 2001-11-15 16:22:00? > I would like to get the previous day, week, month and year in a easy way. > Is there a module that handles this kind of manipulatio

Re: extracting between tags

2001-11-12 Thread Andrea Holstein
Steve Tattersall wrote: > > Please help I am trying to extract the line begining with GB and also the > Title between html tags from multiple html files. > > For example I want to extract the line: (see the html code below) > GB 0152 MSS.126/NUDL > > and also the title which is: > > National

Re: Is there a better 'PERL' way

2001-11-10 Thread Andrea Holstein
Brian Arnold wrote: > > The first part of the code - not so sure how to clean up - but you could > do something like this > > $items[ $j++ ] = $_ foreach ( @{ $T_OWNER_INFO{ $owner }} ); > ($name, $phone, $pager, $email) = @items; Isn't it nearly the same like: @items = @{ $T_OWNER_INFO{ $owne

Re: Duplicates in 2D Array

2001-11-10 Thread Andrea Holstein
Rex Arul wrote: > > Andrea, > > Even if you do have commified strings, it should still work. Right? > > ### > use strict; > my(@array, @unique, %seen); > $array[0] = ["apples","oranges","plums", "Arul, Rex", "Holstein, Andrea", > "Clinton,Bill"]; > $array[1] = ["

Re: simple code

2001-11-10 Thread Andrea Holstein
Henry Hung-Yung Wang wrote: > I have just written some codes, but they are not doing what I wanted them > to do. Here are the codes: > > @motif= ('ACGTACGT', '', 'CCGGCCGG', 'GGCCGGCC'); > > print "Please enter sequences to be examined:\n\n"; > $dna=; chomp $dna; > > @dna=split (//, $dn

Re: CGI.pm Question

2001-11-10 Thread Andrea Holstein
Jess Balint wrote: > > Hello all, I was wonder if there is a way to do this with less `$query->`'s. > And yes, I know the table's not perfect. Any input would be appreciated. > Thanks. > > ~Jess > > print $query->start_form, > $query->start_table({-border=>undef}), >

Re: Duplicates in 2D Array

2001-11-09 Thread Andrea Holstein
Clinton wrote: > > How would I eliminate the duplicate in this 2D array? > my @array; > $array[0] = ["apples","oranges","plums"]; > $array[1] = ["asparagus", "corn","peas"]; > $array[2] = ["ham","chicken","lamb"]; > $array[3] = ["apples","oranges","plums"]; > A quick and dirty solution is: my %

Re: s/pattern/replacement/

2001-11-09 Thread Andrea Holstein
Kai Gollan wrote: > > My intention is to open a file, search for the pattern "DT" und replace > the pattern with "SomethingElse"! > The message after using my skript is "4294967294" but this is not what I > want! What I want ist to display the whole file with my replacements. > Maybe it is a more

Re: Sorting

2001-11-04 Thread Andrea Holstein
David Stavert schrieb: > > The results of my foreach loop looks like > > <[EMAIL PROTECTED]><[EMAIL PROTECTED]> > <[EMAIL PROTECTED]><[EMAIL PROTECTED]> > <[EMAIL PROTECTED]><[EMAIL PROTECTED]> > <[EMAIL PROTECTED]> > <[EMAIL PROTECTED]><[EMAIL PROTECTED]> > <[EMAIL PROTECTED]><[EMAIL PROTECTED]

Re: headers

2001-10-30 Thread Andrea Holstein
Chris Zubrzycki wrote: > > the key is to remove the 2 blank lines surrounding the "by > onion.perl.org " line.PITA. > > here are the full headers: > ... What have you already tried ? If you want to remove blank lines, there is a simple way: Let's suggest your header lines are in the array

Re: send errors to log and screen too.

2001-10-30 Thread Andrea Holstein
Peter Lemus wrote: > > Hi folks, how can I send the output of my script to a > errorlog and to the screen at the same time. It is > sending it only to the errorlog. > A simple stupid solution would be: write all you want to print to a variable. print the variable to screen and print the variable

Re: file test fails 2nd time thru

2001-10-30 Thread Andrea Holstein
Hanson wrote: > > I have a fairly large perl script which optionally runs > through a few subroutines doing similar things to different > files. Sorry I can't be more detailed. > My problem is this: within these subroutines are file tests: > > (-e $File) or die > > type of stuff. > > The first

  1   2   >