RE: $_ question

2001-07-27 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 27, Wagner-David said: > ps I tried to remove the \n on STDIN and got an error: > >Can't modify in chomp at d:\currwrka\00COMM~1\03AAPL~1\aapl210.pl >line 2, near ")" > and the code looked like: > >chomp(); Reading from a filehandle never automatically assigns to a variable, unless

Perl/Tk Tab problem

2001-07-27 Thread John Ertl
I have set up a grid spreadsheet type group of entry widgets. At one point in the programs history i could Tab from one to the next but now the Tab gives me a Bus error. Any Ideas? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

sending mail

2001-07-27 Thread er_pelle
Hi friends, I wanna send mails with the results of some perl scripts. I've installed Debian GNU/Linux with Apache, Perl & sendmail. Do I need some extra module? Thanks for your help -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: unable to config/make perl-5.6.0

2001-07-27 Thread SunDog
Richard ... 6.2 shm ... The number that means something is the kernel release not the Red Hat distribution ... and the error is saying you need a more up-todate version of the glibc ... no surprises here ... Check out the GNU site for the glibc an

Re: $_ question

2001-07-27 Thread Michael Fowler
On Sat, Jul 28, 2001 at 01:22:06AM +0200, Jos I. Boumans wrote: Hopefully my corrections below aren't insulting, but I felt it necessary so that people don't come away from this discussion with the wrong notions. > > if (/foo/) { print "found foo" } > > is the same as saying: > > 'some strin

Re: $_ question

2001-07-27 Thread Sudarsan.Raghavan
Jos, Thanks for the explanation. Thanks, Sudarsan "Jos I. Boumans" wrote: > it's quite simple > > while, for, etc are operators in a way > they do something with whathever you give them > > for, for example, assigns every every element of a list to $_ > unless you specify differently > > so wh

RE: $_ question

2001-07-27 Thread Wagner-David
Thanks. I can work with that. Wags ;) -Original Message- From: Michael Fowler [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 16:29 To: Sudarsan.Raghavan Cc: [EMAIL PROTECTED] Subject: Re: $_ question On Sat, Jul 28, 2001 at 03:45:50AM +0530, Sudarsan.Raghavan wrote: > W

Re: $_ question

2001-07-27 Thread Michael Fowler
On Sat, Jul 28, 2001 at 03:45:50AM +0530, Sudarsan.Raghavan wrote: > What is the reason for this difference in behavior. If you were simply looking for verification that ";" not reading from $_ is correct, it is. If you were looking for a reason behind the potential inconsitency with "while ()"

Re: $_ question

2001-07-27 Thread Jos I. Boumans
it's quite simple while, for, etc are operators in a way they do something with whathever you give them for, for example, assigns every every element of a list to $_ unless you specify differently so what you're doing with this: if (/foo/) { print "found foo" } is the same as saying: 'some

Re: $_ question

2001-07-27 Thread Sudarsan.Raghavan
Maybe the code piece in my mail is misleading. My question is why does the input from STDIN assigned to $_ when given within a loop construct and not when given stand alone. Chris Garringer wrote: > Blunder matches on the under at the end of the string. If you want to match only >under > m/^u

RE: $_ question

2001-07-27 Thread Wagner-David
You are not using warnings which would have told you that you were trying an uninitialize value. Now that said, I don't understand why it doesn't work. One of the higher Gurus will have to fill us in. ps I tried to remove the \n on STDIN and got an error: Can't modify in chomp

Re: $_ question

2001-07-27 Thread Chris Garringer
Blunder matches on the under at the end of the string. If you want to match only under m/^under$/ Chris D. Garringer LAN/WAN Manager Master Certified Netware Engineer Microsoft Certified Systems Engineer Certified Solaris Administrator Red Hat Certified Engineer [EMAIL PROTECTED] fax 713-896-526

$_ question

2001-07-27 Thread Sudarsan.Raghavan
All, This may be a stupid question. I was going through some online perl tutorials and they say that $_ is the default input, output and pattern matching variable. I tried this out [suddy@incq231e hash]$ perl ; if (m/under/) { print "Found Under\n"; } else { print "No Match\n"; }

Re: use Getopt::Std question

2001-07-27 Thread Michael Fowler
On Thu, Jul 26, 2001 at 09:32:41PM -0700, Bob Bondi wrote: > Question: Is there a way to capture the case of bad flags? Getopt::Std already emits error messages when it encounters a flag it's not configured to deal with. You could try setting up a $SIG{__WARN__} handler. If Getopt::Std is using

Re: Read text files only into a hash

2001-07-27 Thread Michael Fowler
On Fri, Jul 27, 2001 at 04:13:08PM -0500, Shepard, Gregory R wrote: > It still appears that the -T is also reading the directories in to the hash. > the statement below looks logical. Is there a test to specifically exclude > directories? There is a test to check if a file is a directory, perldo

RE: Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
You guys are great! -Original Message- From: Wagner-David [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 4:46 PM To: [EMAIL PROTECTED] Subject: RE: Read text files only into a hash I made the change as $dir_file = "$dir/$file"; next if ( -d $dir_file );

RE: Read text files only into a hash

2001-07-27 Thread Wagner-David
I made the change as $dir_file = "$dir/$file"; next if ( -d $dir_file ); # if directory then next next unless -T "$dir_file"; # if not a text or what exhibits text file next Ran it it got only text files and no directories. Wags ;) -Original Message--

Re: newbie DBI

2001-07-27 Thread Brett W. McCoy
On Fri, 27 Jul 2001, Sean O'Leary wrote: > > > ODBC is a low-level API for connecting to databases, and is designed to be > > > accessible from many a programming language. To my knowledge, there's no > > > module for using ODBC from Perl, without using DBI. > > > >Win32::ODBC is an alternative

RE: Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
It still appears that the -T is also reading the directories in to the hash. the statement below looks logical. Is there a test to specifically exclude directories? while ($file = readdir DIR) { next unless -T "$dir/$file" || ~/^\./; $dir_file = "$dir/$file" if -T "$di

Re: newbie DBI

2001-07-27 Thread Sean O'Leary
At 04:54 PM 7/27/2001, you wrote: >On Fri, 27 Jul 2001, Sean O'Leary wrote: > > > ODBC is a low-level API for connecting to databases, and is designed to be > > accessible from many a programming language. To my knowledge, there's no > > module for using ODBC from Perl, without using DBI. > >Win3

Re: jpg resize

2001-07-27 Thread Sean O'Leary
>I need to resize a slew of jpgs I have in archive. They are 1024x768, way >too big for web viewing. I need them smaller, around 300x200. > >Is there a module I should look into for graphic resizing? Is this >possible with PERL? Where should I go to look at example scripts? PerlMagick rawks.

RE: Read text files only into a hash

2001-07-27 Thread Mooney Christophe-CMOONEY1
Sorry -- let me try that again ... Why don't you change your next statement to: next unless -T "$dir/$file" || /^\./; -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:47 PM To: [EMAIL PROTECTED] Subject: Read text files only into a hash

Re: newbie DBI

2001-07-27 Thread Brett W. McCoy
On Fri, 27 Jul 2001, Sean O'Leary wrote: > ODBC is a low-level API for connecting to databases, and is designed to be > accessible from many a programming language. To my knowledge, there's no > module for using ODBC from Perl, without using DBI. Win32::ODBC is an alternative to using DBD::ODBC

RE: Read text files only into a hash

2001-07-27 Thread Mooney Christophe-CMOONEY1
Why don't you change your next 'next unless -T "$dir/$file"'; That will skip over any non-text files, including dirs and '.' -Original Message- From: Shepard, Gregory R [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 3:47 PM To: [EMAIL PROTECTED] Subject: Read text files only into

Re: newbie DBI

2001-07-27 Thread Sean O'Leary
At 01:56 PM 7/27/2001, you wrote: >** Using ActiveState Build 522 (NT) > >I'm trying to decide on using DBI or an ODBC connection for moving data >into or out of MS ACCESS 97 (or 2000) and back into the ACCESS table >[yep, or change inside table]. > >Given I need to perform all the usual extract a

Read text files only into a hash

2001-07-27 Thread Shepard, Gregory R
All, I am trying to read only text files (using the -T test) from a directory into a hash, and not directories themselves. How do I prevent it from it reading in directories? This sounds like a basic question and know there is probably an easy answer... but I can't think of it. Thanks. @ARG

RE: Recursive find for a file within a directory

2001-07-27 Thread Shepard, Gregory R
All, I am trying to read only text files (using the -T test) from a directory into a hash, and not directories themselves. How do I prevent it from it reading in directories? This sounds like a basic question and know there is probably an easy answer... but I can't think of it. Thanks. @ARGV=$d

GD:Graph

2001-07-27 Thread Matija Papec
This is a little bit offtopic, but I'm trying to figure out how to plot this chart with graph module and it drives me nuts already :< http://www.inet.hr/~mpapec/stuff/gdgraph.gif Ok, it has two Y axis, one to the left and one to the right. White and black bars are described by left Y("cijena")

RE: Recursive find for a file within a directory

2001-07-27 Thread Mooney Christophe-CMOONEY1
use File::Find;) -Original Message- From: Sudarsan.Raghavan [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 2:52 PM To: [EMAIL PROTECTED] Subject: Recursive find for a file within a directory Hello, I am new to perl. I want to find for a file recursively within a directory. Is t

Recursive find for a file within a directory

2001-07-27 Thread Sudarsan.Raghavan
Hello, I am new to perl. I want to find for a file recursively within a directory. Is there a perl module already present that will do the job for me, or do I have to write my own. My attempt at the same I am trying this on a VMS machine. #Begin searchDirforFile.pl #Usage perl searchDirforFile.p

jpg resize

2001-07-27 Thread todd
I need to resize a slew of jpgs I have in archive. They are 1024x768, way too big for web viewing. I need them smaller, around 300x200. Is there a module I should look into for graphic resizing? Is this possible with PERL? Where should I go to look at example scripts? any thoughts would make

Re: newbie DBI

2001-07-27 Thread Akshay Arora
There are quite a few ODBC modules out there. One that lets you program using the actual OLE ( I think they all do really), is the Win32 set of modules written by Dave Roth. The book he wrote is decent, all about Perl Win32 programming. I personally found programming for Access using Perl was quit

RE: CGI to rewrite a URL

2001-07-27 Thread Rich Fernandez
Thanks folks (Bob, Mel)! I got 2 different ways to do the same thing. Choice is good :-) --richf -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: last line

2001-07-27 Thread Walt Mankowski
COLLINEAU writes: > How can i do to delete the last line of a file ? >From perlfaq5... How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? In the unique case of deleting lines at the end o

Re: CGI to rewrite a URL

2001-07-27 Thread Mel Matsuoka
At 03:09 PM 07/27/2001 -0400, Rich Fernandez wrote: >Hi, > >I've been asked to write a CGI script that takes a URL of the form: > https://webserver/cgi-bin/myscript.cgi/myreport > >and redirects the browser to: > https://webserver/cgi-bin/myscript.cgi/full/path/to/report/myreport > >In

RE: CGI to rewrite a URL

2001-07-27 Thread Bob Showalter
> -Original Message- > From: Rich Fernandez [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 3:09 PM > To: [EMAIL PROTECTED] > Subject: CGI to rewrite a URL > > > Hi, > > I've been asked to write a CGI script that takes a URL of the form: > https://webserver/cgi-bin/myscr

CGI to rewrite a URL

2001-07-27 Thread Rich Fernandez
Hi, I've been asked to write a CGI script that takes a URL of the form: https://webserver/cgi-bin/myscript.cgi/myreport and redirects the browser to: https://webserver/cgi-bin/myscript.cgi/full/path/to/report/myreport In other words, we want to hide the true URL of the report fr

RE: in over my head in hashes again

2001-07-27 Thread Bob Showalter
> -Original Message- > From: Jerry Preston [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 1:09 PM > To: begginners > Subject: in over my head in hashes again > > > Hi! > > I am lost again: > > > > %T_QUESTION = { (snip remainder) The construct %foo = { blah ... };

Re: 4 hashes into 1 hash

2001-07-27 Thread Sean O'Leary
At 10:53 AM 7/27/2001, you wrote: >Try: > >my %data = ( %one, %two %three, %four ); This is a good solution, but be careful of one thing. If there are duplicate keys in any of the hashes, the last in will win. Meaning, that if you have a key of 'my key' in %one and in %four, the value of

Re: newbie DBI

2001-07-27 Thread Brett W. McCoy
On Fri, 27 Jul 2001, Steve.Few wrote: > I'm trying to decide on using DBI or an ODBC connection for moving data > into or out of MS ACCESS 97 (or 2000) and back into the ACCESS table > [yep, or change inside table]. If you use DBI, you will need to use DBD::ODBC anyway, since there isn't a specf

newbie DBI

2001-07-27 Thread Steve.Few
** Using ActiveState Build 522 (NT) I'm trying to decide on using DBI or an ODBC connection for moving data into or out of MS ACCESS 97 (or 2000) and back into the ACCESS table [yep, or change inside table]. Given I need to perform all the usual extract and append, etc. tasks, do any of you have

RE: in over my head in hashes again

2001-07-27 Thread Mooney Christophe-CMOONEY1
it just takes practice. %T_QUESTION = ( d4 => { names => { "1" => { "Q" => "What is your name", "C" => ["Jerry","Ron","Tony","Jack"],

in over my head in hashes again

2001-07-27 Thread Jerry Preston
Hi! I am lost again: %T_QUESTION = { d4 => ( names => ( "1" => [ { "Q" => "What is your name",

Re: $1

2001-07-27 Thread John Fox
Alessandro, Alessandro Lenzen wrote: > >#!/usr/bin/perl -w >use strict; > >my($string) = "This is a test!"; >my($ergebnis); > >$string =~ m/(\s\w+\s)/g; >$ergebnis = $1; >print("$ergebnis\n"); > > >Shouldn't a be printed? I'm assum

RE: 4 hashes into 1 hash

2001-07-27 Thread Abdulaziz Ghuloum
Hello, Did you mean: for(keys(%data)){ print "$_ = $data{$_}\n"; } or you actually meant the assignment print $_ = $data{$_}; Aziz,,, In article <1A191D5C8A79D511A7A800306E05E9FC067398@EXCHANGE_SERVER>, "Chris Rutledge" <[EMAIL PROTECTED]> wrote: > John, > > That works much better

Re: readdir

2001-07-27 Thread Maxim Berlin
Hello COLLINEAU, Friday, July 27, 2001, COLLINEAU Franck FTRD/DMI/TAM <[EMAIL PROTECTED]> wrote: CFFDT> I have a problem with my code: CFFDT> #!/usr/bin/perl -w CFFDT> opendir (LMI,"lmi") || die "impossible d'ouvrir lmi: $!"; CFFDT> $chaine="BEGIN PAPIER"; CFFDT> while($fichier=readdir LMI) C

Re: setting and importing ENV from within PERL

2001-07-27 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Venkat Mohan <[EMAIL PROTECTED]> wh ispered: | $ENV{MY_VAR} = "test"; | | will set the env var MY_VAR However, it will only set it in the script. Once the script exits and you are back to the parent shell, that variable goes away. There really is no way

readdir

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
I have a problem with my code: #!/usr/bin/perl -w opendir (LMI,"lmi") || die "impossible d'ouvrir lmi: $!"; $chaine="BEGIN PAPIER"; while($fichier=readdir LMI) { open (FICHIER,"lmi/$fichier") || die "impossible d'ouvrir $fichier: !$\n"; open(TEMP,">>temp.htm")|| die "impossible d

Re: checking for an open filehandle?

2001-07-27 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 27, Barry Carroll said: >Is this code good enough for doing that job? > > if (!(-e TEMPLATE)) No, use the fileno() function. if (defined fileno TEMPLATE) { # it was opened ok } -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ I am Marillion

Re: 4 hashes into 1 hash

2001-07-27 Thread Paul
--- Chris Rutledge <[EMAIL PROTECTED]> wrote: > Hello all, > Here's what I have..4 single dimension hashes that I'm trying to > use to populate a single hash (single dimension) > > with... > > %data = return_hash( %one, %two, %three, %four ); Unless I misunderstand, you're wor

RE: lost in hashes

2001-07-27 Thread Mooney Christophe-CMOONEY1
Sure enough, you're right! That's VERY nice to know, since i'm trying to deal with multidemensional lists myself right now. ;) -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 9:34 AM To: '[EMAIL PROTECTED]' Subject: RE: lost in hashes > ---

RE: 4 hashes into 1 hash

2001-07-27 Thread Chris Rutledge
John, That works much better than before, however, when i try to spin through the hash via... for (keys(%data)) { print $_ = $data{$_}; } that only seems to get the data for the first hash passed to %data.%data = ( %one, %two, %thre

RE: lost in hashes

2001-07-27 Thread Bob Showalter
> -Original Message- > From: Mooney Christophe-CMOONEY1 [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 10:21 AM > To: begginners > Subject: RE: lost in hashes > > ...Also, when you reference some field from $T{d4}, you need to > be sure to deREFERENCE it like this: > > $T{d4}

RE: lost in hashes

2001-07-27 Thread Mooney Christophe-CMOONEY1
Not hard to do when dealing with references! ;) The problem is that you are assigning a REFERENCE TO A HASH to the HASH itself, because you're using '{}' when assigning to %T. $T{d4} has the opposite problem -- it needs to be associated with a SCALAR, ie. a REFERENCE TO A HASH. '()' is a LIS

RE: lost in hashes

2001-07-27 Thread mark crowe (JIC)
Looks like you want braces after d4 => (and the corresponding closing one) rather than brackets - ie { & }, not ( & ). Cheers Mark C > -Original Message- > From: Jerry Preston [mailto:[EMAIL PROTECTED]] > Sent: 27 July 2001 15:12 > To: begginners > Subject: lost in hashes > > > Hi, >

lost in hashes

2001-07-27 Thread Jerry Preston
Hi, I just can't see where I have missed it! %T = { d4 => ( names => [ "", "Ron", "Tony", "Jeff", "Scott", ], ), }; print $query->popup_menu( -name=>'Test', -values => $T{ "d4" }{ "names" },

RE: Passaing arrays or array references as parameters

2001-07-27 Thread Bob Showalter
> -Original Message- > From: Rahul Garg [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 8:55 AM > To: [EMAIL PROTECTED]; Perl Beginners > Subject: Passaing arrays or array references as parameters > > > Hello Everybody, > > what i want is to pass an array(reference) as a para

Re: 4 hashes into 1 hash

2001-07-27 Thread Troy Denkinger
Chris, On Friday 27 July 2001 08:55, Chris Rutledge wrote: > Here's what I have..4 single dimension hashes that I'm trying to > use to populate a single hash (single dimension) What you posted actually works, but I doubt it works the way you think it's working. When you pass a series

RE: 4 hashes into 1 hash

2001-07-27 Thread John Edwards
Try just %data = (%one, %two, %three, %four); you haven't got any duplicate key names have you?? John -Original Message- From: Chris Rutledge [mailto:[EMAIL PROTECTED]] Sent: 27 July 2001 13:56 To: [EMAIL PROTECTED] Subject: 4 hashes into 1 hash Hello all, Here's what I hav

RE: regular expressions

2001-07-27 Thread Rashid Faraby
Another way to do it is to use Damian Conway's Text::Autoformat module. It's smart enough to handle multiple modes of case conversions. For instance: The 'title' mode capitalizes the first letter of every word in a sentence: "Hello World. Goodbye. What A Cruel World" The 'highlight' mode cap

4 hashes into 1 hash

2001-07-27 Thread Chris Rutledge
Hello all, Here's what I have..4 single dimension hashes that I'm trying to use to populate a single hash (single dimension) with... %data = return_hash( %one, %two, %three, %four ); sub return_hash { my ( %one, %two, %thre

RE: deleting lines

2001-07-27 Thread Bob Showalter
> -Original Message- > From: Me [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 5:30 AM > To: COLLINEAU Franck FTRD/DMI/TAM; Perl (E-mail) > Subject: Re: deleting lines > > > > I would like too delete the 2nd, 3rd, 4, and 5 lines of a file. how > > can i do ? > > Try this at

RE: UNIQUE ID problems...

2001-07-27 Thread Bob Showalter
> -Original Message- > From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 2:50 AM > To: Beginners (E-mail); Beginners-Cgi (E-mail) > Subject: UNIQUE ID problems... > > > List, > > Interesting problem that I think proves just how much I > really don't know

RE: setting and importing ENV from within PERL

2001-07-27 Thread Bob Showalter
> -Original Message- > From: perl newbie [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 26, 2001 6:22 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: setting and importing ENV from within PERL > > > I am trying to figure out if there is a way to : > > a) set an ENV

checking for an open filehandle?

2001-07-27 Thread Barry Carroll
Hi, i have this small but of code in a script. My script opens a file for editing, and assigns a filehandle 'TEMPLATE' to it. I need to check in another part of the script if it open or closed. Is this code good enough for doing that job? if (!(-e TEMPLATE)) {

Re: last line

2001-07-27 Thread Greg Meckes
--- COLLINEAU Franck FTRD/DMI/TAM <[EMAIL PROTECTED]> wrote: > Hi! > > How can i do to delete the last line of a file ? > > Thanks > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Try: #Get the data open(FILE, $file) or die "Couldn't o

Re: using modules in windows version of perl

2001-07-27 Thread Jos I. Boumans
my guess would be that the locating of use'd modules is a compile time directive... while your push @INC is a runtime thing ie, too late besides, you use the 'use lib' pragma anyway ie: use lib qw($ENV{'PERL_LIB'}); hth, Jos Boumans - Original Message - From: "Tirumal Reddy" <[EMAIL P

using modules in windows version of perl

2001-07-27 Thread Tirumal Reddy
hi, My problem is to use Modules which are already built in and i want to run this perl script from my DOS Prompt and i have installed win version of perl.I tried the below program: #!/usr/bin/perl -w #-

AW: $1

2001-07-27 Thread Alessandro Lenzen
Making a mistake once can be exused, making it twice is stupidity and making the same mistake a third time only proves you have no brain ;-) Sorry, I figured out where the problem is... al -Ursprüngliche Nachricht- Von: Alessandro Lenzen [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 27.

Re: errors

2001-07-27 Thread Sascha Kersken
I see. Maybe you should post a bit more of it than just the relevant lines. I just notice that now, you're talking about $input while the script reads $INPUT - and that, of course, makes a difference. Sascha -- >Von: "Sally" <[EMAIL PROTECTED]> >An: "Sascha Kersken" <[EMAIL PROTECTED]> >

Re: $1

2001-07-27 Thread Jos I. Boumans
Hi, actually, that should print ' is ' the reason for that is that regexes will try to match the earliest possible string, but as much as possible. so in your case, you say: find a whitespace # \s find one or more word chars# \w+ find a white space#

Re: errors

2001-07-27 Thread Jos I. Boumans
concatenation means 'glueing stuff togehter' you can use the . operator for that, ie like i showed in my example however, print cats stuff too, since you are putting variables into the print statement it needs to interpolate check out http://japh.nu it has a tutorial on data types, it explains t

RE: errors

2001-07-27 Thread Sascha Kersken
Hi again! Concatenation means that several strings are tied together as one. The usual way to do this in Perl is using the '.' operator: my $string1 = "Hello "; my $string2 = "World"; my $string3 = $string1.$string2; In your code, you DON'T actually use the '.' operator. But you are in fac

$1

2001-07-27 Thread Alessandro Lenzen
Hello folks! I'm reading Jos Boumans "Perl Beginners Tutorial To Regular Expressions". I'm stuck with a problem. Jos writes: Also realise that $1 and friends store the contents of the last succesfull match... I wanted to check that and wrote this code: #!/usr/bi

RE: errors

2001-07-27 Thread Sally
Thanks for that, but what does concatenation mean and where have I used it? Sally -Original Message- From: Jos I. Boumans [mailto:[EMAIL PROTECTED]] Sent: 27 July 2001 09:31 To: Sally; perl Subject: Re: errors those errors mean that the variable you're trying to print out holds no valu

Re: deleting lines

2001-07-27 Thread Me
> I would like too delete the 2nd, 3rd, 4, and 5 lines of a file. > how can i do ? Try this at a shell prompt: perl -ni.bak -e '$. =~ /[2-5]/ or print' FILENAME -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: errors

2001-07-27 Thread Sascha Kersken
Hi! As it seems, you're trying to run a CGI script directly from the console - so the script doesn't know what to do with the CGI environment variable CONTENT_LENGTH, and later on, it doesn't know the hash %INPUT either, which seems to be the input that was submitted from a HTML form. This scrip

RE: regular expressions

2001-07-27 Thread PURMONEN, Joni
I don't think you need to do regex here. I don't have a perl machine here right now so I can just give you pointers: use "split" to get the separate words into strings, then go trough those strings and do ucfirst $string; this will return you the string with first letter uppercased and put them

deleting lines

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I would like too delete the 2nd, 3rd, 4, and 5 lines of a file. how can i do ? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: code doesn't work

2001-07-27 Thread Jos I. Boumans
ok, first, what are you trying to do? secondly, dont put a filehandle in an array.. it's A BAD THING! this means you're slurping the entire file into memory, as well as having to allocate a bit of extra memory for perl to understand each line should be a different value of the array. if you're si

code doesn't work

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
this code doesn't work: @temp=; $temp[2]=""; $temp[3]=""; $temp[4]=""; $temp[5]=""; print TEMP @temp; The error message is "Use of uninitialized value in print at 01_info.pl line 25, line 1." can anybody help me ? Franck -- To unsubscribe, e-

Re: errors

2001-07-27 Thread Jos I. Boumans
those errors mean that the variable you're trying to print out holds no value. ie, this would cause such an error: $bar = $foo . 'quux'; since I didnt assign any value to $foo, it will say i usded an unitialized variable. a little pointer for readabillity of your code; instead of escaping all

Re: UNIQUE ID problems...

2001-07-27 Thread Jos I. Boumans
if you say 'unique' you probably want to concider an autonumber field in your db for the primary key it's *always* unique... you can even do a query on the db to give you the current_id for a table (so the one you want to insert would be current_id + 1 ) depending on what db you use, the sql is

Re: regular expressions

2001-07-27 Thread Jos I. Boumans
This is exactly why we have \b consider the following: $_ = "hello world. goodbyecruel world"; s/\b(.)/uc$1/seig; print; this should do exactly what you want... it matches the first character after a word boundary and uppercases it. there's an explenation about regexes at the

errors

2001-07-27 Thread Sally
I'm getting error messages that I don't understand. Below are the errors and the associated line of code, any help would be much appreciated, Sally Use of uninitialized value in read at guest.pl line 35. read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); Use of uninitialized value in concatenation

last line

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! How can i do to delete the last line of a file ? Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Why does this conditional fail? Perl bug?

2001-07-27 Thread Jos I. Boumans
because you are using == that's for numerical compares numerical, SOS and 'all' are the same use 'eq' hth Jos Boumans - Original Message - From: "Bob Bondi" <[EMAIL PROTECTED]> To: "Beginners-perl" <[EMAIL PROTECTED]> Sent: Friday, July 27, 2001 12:54 AM Subject: Why does this conditio