Re: A Split Question

2001-07-03 Thread Jos Boumans
bits of course) so in short, try: my ($d,$m,$y) = $string =~ /(\d+)(\D+)(\d+)/ \D is perfectly safe here, but tehn again, we know context... =) hth, Jos Boumans snip I stand by my reply to this post. Sure, unpack is quicker. But if you use regex, i always prefer to use my own defined

Re: using the backspace \b character

2001-07-02 Thread Jos Boumans
i think what you really want to use then is chomp or a regexp.. or you'd have to say print hello\n print \b print world etc hth, Jos Boumans Bob Mangold wrote: Hello, I know I can use the backspace character to overwrite previous characters and the such, but can I use it to backup

Re: Finding @INC

2001-06-27 Thread Jos Boumans
Please use the the 'use lib' pragma, rather then fiddling with @INC concider: use lib (../foo); rather than: BEGIN: { push @INC, '../foo' } perldoc lib for more info hth Jos Boumans Maxim Berlin wrote: Hello Dennis, Tuesday, June 26, 2001, Dennis Fox [EMAIL PROTECTED] wrote: DF

Re: Finding @INC

2001-06-27 Thread Jos Boumans
because push @INC is a runtime statement, use lib is a compile time statement meaning you'll be alerted if the dir doesnt exist, or something else goes wrong at the moment you start your script, rather then it dying half way when not findin a file. hth Jos Boumans Maxim Berlin wrote: Hello

Re: to delete the trailing newline

2001-06-27 Thread Jos Boumans
you might want to try to use 'chomp' on your variable... this function is specifically there to 'chomp off' trailing newlines you'll often see it used as: open FH, 'foo.txt'; while(FH){ chomp; #remove trailing newline do something } perldoc -f chomp for details hth, Jos Boumans

Re: Incrementing Strings

2001-06-27 Thread Jos Boumans
How do you mean? concider: if ('a' == 'b') { print foo } # this will print 'foo', seeing 'a' and 'b' both yield '1' in numeric context here. however $x = 'a'; print $x + 4; will print '4'; Jos Boumans Converting 'a' to a number gives 0. -- Paul Johnson - [EMAIL PROTECTED] http

Re: Incrementing Strings

2001-06-27 Thread Jos Boumans
for poining out the mistake Chas Owens wrote: On 27 Jun 2001 17:45:18 +0200, Jos Boumans wrote: How do you mean? concider: if ('a' == 'b') { print foo } # this will print 'foo', seeing 'a' and 'b' both yield '1' in numeric context here. You mean 0 not 1 don't you? however $x

Re: removing ASCII characters from array

2001-06-25 Thread Jos Boumans
and for esthetics: print join ',' @array; timtowtdi =) John Edwards wrote: $data = Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239; @array = $data =~ /=(\d*)/g; print $array[0], $array[1], $array[2]\n; -Original Message- From: Alex Nelson [mailto:[EMAIL PROTECTED]] Sent:

Re: Another Regex Question

2001-06-22 Thread Jos Boumans
if there is one } you can print them out as a csv file as follows: for(@store){ print ( (join ',', @$_) . \n)} this is a bit advanced regexes, but you can check out a tutorial on them at www.sharemation.com/~perl/tut to give you an insight in them hth, Jos Boumans Ken wrote: One thing to do would

Re: output filenames as inputs

2001-06-22 Thread Jos Boumans
on that note, you can also use the getopt module, that lets you specify switches like you're used to on any linux system as follows: script.pl -i input.txt -o output.txt look at perldoc getopt for a simple description regards, Jos Boumans Brett W. McCoy wrote: On Thu, 21 Jun 2001, Pedro

Re: Pooling of objects and session data

2001-06-22 Thread Jos Boumans
questions about it to the list you can get the latest download from either sourceforge.net or from poe.perl.org i recently made a ppm for windows to install the latest version, which should be available for public download shortly as well hth, Jos Boumans Rajeev Rumale wrote: Dear Chas

Re: to delete only one line

2001-06-22 Thread Jos Boumans
maybe there's a more elegant way, but this will work: open I, input.txt; open O, output.txt; while(I) { print O unless $. == $foo } where $foo is the line number you dont want printed. hth, Jos Boumans Stéphane JEAN BAPTISTE wrote: HI. I'm looking for a method to delete the line number

Re: What's a good pre-built binary Perl for Windoze?

2001-06-22 Thread Jos Boumans
www.activestate.com is where you should look hth, Jos Boumans Jude Suszko wrote: I'd like to get my feet wet with a decent pre-built binary Perl before I try building my own from sources. At the moment I'm stuck with a Win98 SE platform to run it on. I found several possibilities

Re: DBI Module

2001-06-22 Thread Jos Boumans
try reading this article: http://www.perl.com/pub/1999/10/DBI.html hth, Jos Boumans Diego Riaño wrote: Hi Everybody I am trying to use de perl DBI module to use a MySQL database. I want to know where can I find a tutotial or maybe a HowTo (I do not know?) about perl DBI module? Could

Re: Last page

2001-06-21 Thread Jos Boumans
Assuming you'll utilise the CGI module, this would work: my $q = new CGI; my $calling_page = $q-referer(); hth, Jos Boumans Stéphane JEAN BAPTISTE wrote: How can I get the URL which was calling my script (like document.referrer in Javascript) tks

Re: more class stuff

2001-06-19 Thread Jos Boumans
a function filling it... if my assumption is true, then you'd want something like this: sub new { my @Next = function(); my $self = { @Next, @_, } } hope this helps, Jos Boumans PS, if you want to read more about

Re: fork

2001-06-18 Thread Jos Boumans
/pub/2001/01/poe.html and of course, all contents, faqs, docs etc are available from poe.perl.org Hope this helps, Jos Boumans Ronald J. Yacketta wrote: Folks, Can someone shed some light on using fork to spawn 2+ simultaneous process? I am reading in allot of logfiles and splitting them

Re: AW: Problems with LWP::UserAgent and HTTP::Response

2001-06-18 Thread Jos Boumans
, which above snippet shows you how to do... and then it's as simple as doing the last step: do the request, get the responce... i hope this example shows you The Path To The Dark Side ;-) Jos Boumans Ela Jarecka wrote: Thanks, at least I know that I am sending my XML properly.. But I still get

Re: use of split command

2001-06-13 Thread Jos Boumans
of option 2... the worst of both worlds so to speak last remark i want to make is that it's always good to run 'use strict' and force yourself to use lexicals (my'd vars). hope this helps, Jos Boumans open (ACCS, C:\\Perl\\BioPerl-0.7\\Seqdata\\Accession.txt) or die can't open Accessions file; @ets

Re: Strict, require and hashes..

2001-06-13 Thread Jos Boumans
of package indication... now, what you *really* want to do is package the config file and use exporter to make sure you don't clobber namespaces, but that might be a bit advanced, so for now, this should solve your problem hope this helps, Jos Boumans Dianne Van Dulken wrote: Hi all, I

Re: Calling touch ...

2001-06-12 Thread Jos Boumans
or checks, you could add an 'or die file not created' or even eval it... hope this helps Jos Boumans [EMAIL PROTECTED] wrote: I'm trying to write a script that opens a file, then matches some characters, and then writes the output to an HTML file on the fly. Everything works except I also

Re: Installing new Modules problem

2001-06-12 Thread Jos Boumans
Sounds like an error somewhere during your initial installation... i recall seeing that happen more often on this list you might want to concider checking the AS support pages, or mailing them your problem hth, Jos Boumans [EMAIL PROTECTED] wrote: Hi, I did also try this but I get

Re: testing on email characters

2001-06-12 Thread Jos Boumans
Boumans PS html tags end /tag Chas Owens wrote: On 12 Jun 2001 17:45:16 +0200, Jos Boumans wrote: try this: unless (/^[-\.\w]+$/) { print you cheater! } this will check if from beginning to end of $_ it contains - . (not even sure you need to \ the . ) or any word character (a-z A-Z

Re: NEW LINE

2001-06-11 Thread Jos Boumans
of $in... if you dont want that, set the 'my $in' above the block, rather then in it hth, Jos Boumans Me wrote: Can anyone send me any solution to read the paragraph from a text file? To read paragraphs (delimited by one or more blank lines (really blank, no spaces or tabs)), change

Re: Getting to the contents of a class..

2001-06-11 Thread Jos Boumans
to the list, it would make it easier for us to indicate the problem hth, Jos Boumans Ela Jarecka wrote: foreach my $item ( keys $reqrec-myflds ) { #line 26 ... } I get an error: 'Can't locate object method myflds via package DataReq at makeReq line 26' How should I indicate

Re: AW: Getting to the contents of a class..

2001-06-11 Thread Jos Boumans
the first tutorial (data structures) and the third one (references) i think they will clear up most of the confusion. hope this helps, Jos Boumans Ela Jarecka wrote: Unfortunately, it doesn't seem to work... :-( My constructor: sub new { my $that = shift; my $class = ref

Re: Mysql interface with perl on win 2k, Someone please help !

2001-06-05 Thread Jos Boumans
. good luck, Jos Boumans [EMAIL PROTECTED] wrote: Hi, Im trying to connect a perl program to a mysql database on my home computer running win 2k. I can connect, but i have no idea of how to extract the information out of tables using perl. I have a book about SQL, but it never mentions

Re: automatic cgi scripts?

2001-06-05 Thread Jos Boumans
Give it an entry in the crontab man cron man crond that should explain functionallity for you good luck Jos Boumans Sanchit Bhatnagar wrote: Hi, Is there any way to automatically execute a cgi script in un*x on a preset delay, say for ex. once every day at 0800hrs.? thanks, san.

Re: profiles

2001-05-21 Thread Jos Boumans
login name is 'foo', your home dir will by default be, /home/foo and the profile will be in the .profile file now, this is no guarantee... maybe your sysadmin set up the box differently, or you dont run redhat or, or or... I hope this helps, if not, try a linux mailing list Regards, Jos Boumans

Re: elegant REGEX

2001-05-18 Thread Jos Boumans
i'm not too fond of below suggestion's variable naming, but hey, tmtowtdi here's my 2 bits: my $foo = 'test case total : 32456 allocated : 12000 from tech'; my ($num1,$num2) = $foo =~ /(\d+).+?(\d+)/; Good luck, Jos Boumans Aaron Craig wrote: my $sLine = test case total : 32456

Re: Compare statement.

2001-05-17 Thread Jos Boumans
be if($a || ($b = 2) ) { print foo } alltho what jeff said is very true: use OR for strings... just like you should use EQ rather then == Regards, Jos Boumans snip Jeff Pinyan wrote: On May 17, Doug Johnson said: my $x = return; if (($x = a) || ($x = test ) || ($x = return ) || ($x = x-retun

Re: .dat

2001-05-16 Thread Jos Boumans
to exclusively tell you where that file belongs to. On a side note, should i be adressing this mail to Kevin or Sally? regards, Jos Boumans Kevin Williams wrote: Does anybody know what type a file with a .dat extension is? I've come across them as backup files, but have found one in a perl script

Re: FW: delete files

2001-05-15 Thread Jos Boumans
file names something like if (/^[A-Z]+$/) { do_your_stuff; } Try it out, see how far you get and feel free to ask if you get stuck! Kind regards, Jos Boumans Porter, Chris wrote: Any ideas??? -Original Message- From: Porter, Chris Sent: Tuesday, May

Re: New to Perl

2001-05-15 Thread Jos Boumans
' book) Both published by O'reilly... If you want some tutorials, you might want to try MJD's site at perl.plover.com or www.sharemation.com/~perl/tut for some really basic tutorials. Of course learn.perl.org also has some advice on which books to read and such. Hope that helps, Jos Boumans RS

Re: passing part of an array to a function

2001-05-15 Thread Jos Boumans
like this: @foo = (1,2,3,4,5,6,7,8,9); bar(@foo[1..5]); sub bar { my @a = @_; for (@a) {print} } #which will nicely print '23456' I hope this will solve your problem for now... Regards, Jos Boumans Paul wrote: --- Gary Stainburn [EMAIL PROTECTED

Re: perl newbie

2001-05-15 Thread Jos Boumans
Ok, it's hard to help you without knowing the exact error that is generated. So it would help if you posted that too furthermore, that bit of code seems to be in order then, altho the first in ..cgi?tickers=yyyrefresh=x shouldnt be there... Regards, Jos Boumans Peter wrote: yes

Re: perl newbie

2001-05-15 Thread Jos Boumans
help you as such... i'd need to look at the entire code for that i think Regards, Jos Boumans Peter wrote: i corrected the before tickers. when i append the refresh=x, i get a software error: Execution of cgi aborted due to compilation errors without the refresh=x, the script runs fine

Re: to reach an URL

2001-05-07 Thread Jos Boumans
Stephane, what you are looking for is the LWP module.. it comes standard with any ActiveState perl release but is not standard with Linux (or at least RedHat) try search.cpan.org if you need to obtain and look for LWP you'll find the documentation very informational. Regards, Jos Boumans