Re: CGI and mySQL book, any recommendation.

2004-06-01 Thread Shaun Fryer
 By the way... it's consensus amongst experts that MySQL has hit
 nearly end-of-life.  If you're starting a new project, use PostgreSQL
 instead.  A real Database... not a database wannabe.
 The only reason to use MySQL these days is ignorance or legacy.
 
 I've done a quick search on Google (mysql vs postresql) and all the hits
 I've seen, including a very detailed comparison of the two by Sourceforge
 principal Tim Perdue give both high marks. I haven't read anything so far
 supporting your position (MySQL is a wannabe and nearly end-of-life).
 While I am not refuting your claims, I would appreciate a little evidence 
 in support of these claims so that I can better judge for myself.
 
 Agreed. I have requested this from him before, but didn't get much.

All the articles I've read which take this position mention that MySQL is
not ACID compliant, whereas PostgreSQL is. I don't know if this is still
true or not, but it could be a source of this opinion. TMK however MySQL
is still a little bit faster.

-- 
=
 Shaun Fryer
=
 http://sourcery.ca/
 ph: 905-529-0591
=

Science is like sex: occasionally something useful
comes out of it, but that's not why we do it.
-: Richard Feynmann


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: CGI and mySQL book, any recommendation.

2004-06-01 Thread Octavian Rasnita
Does this mean that PostgreSQL is faster than MySQL?
In most simple web applications I could work even with text files databases,
so MySQL is very enough.

But if PostgreSQL is faster, the situation changes...

Teddy

- Original Message - 
From: Randal L. Schwartz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 01, 2004 2:52 PM
Subject: Re: CGI and mySQL book, any recommendation.


  Wiggins == Wiggins D'Anconia [EMAIL PROTECTED] writes:

 Wiggins Agreed. I have requested this from him before, but didn't get
much.

 I haven't responded because I've been using the net at 40 cents per
 minute from a satellite link on a ship this past week, and right now
 I'm using a 10 cents per minute cellphone modem.  When I get back to a
 free link, I'll post more.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: CGI and mySQL book, any recommendation.

2004-06-01 Thread Bill Jones
Greetings =)

--- Randal L. Schwartz [EMAIL PROTECTED] wrote:
 The only reason to use MySQL these days is ignorance or legacy.


Even Blackboard, a major CMS / distance learning software developer,
abandoned MySQL in favor of baby Oracle.

(Baby Oracle is no better than PostgresSQL IMO.  Plus PostgresSQL is
free.)

Regards;
-Sx-

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




OT: mysql vs. postgresql (was: Re: CGI and mySQL book, any recommendation.)

2004-06-01 Thread Wiggins d Anconia
  Wiggins == Wiggins D'Anconia [EMAIL PROTECTED] writes:
 
 Wiggins Agreed. I have requested this from him before, but didn't get
much.
 
 I haven't responded because I've been using the net at 40 cents per
 minute from a satellite link on a ship this past week, and right now
 I'm using a 10 cents per minute cellphone modem.  When I get back to a
 free link, I'll post more.


That is a very good reason, actually I was referring to back in
December, apparently that was the beginners list not the beginners-cgi, see:

http://groups.google.com/groups?hl=enlr=ie=UTF-8selm=3FD34DFD.7080207%40danconia.org

 
 But in short, MySQL was great when it was the only game in town.
 But PostgreSQL has leapfrogged MySQL now in every area including
 features, performance, *and* license.  There's no point in starting
 a new project with MySQL, *except* for legacy.

Ok, license is a good cause.  When you state features and performance,
are there specifics, etc?  I am wanting to believe you, and you state
ignorance as a reason, and that is probably the biggest, so enlighten me
so that I am compelled to switch.  

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: CGI and mySQL book, any recommendation.

2004-06-01 Thread Camilo Gonzalez
Randal L. Schwartz wrote:
Wiggins == Wiggins D'Anconia [EMAIL PROTECTED] writes:
   

Wiggins Agreed. I have requested this from him before, but didn't get much.
I haven't responded because I've been using the net at 40 cents per
minute from a satellite link on a ship this past week, and right now
I'm using a 10 cents per minute cellphone modem.  When I get back to a
free link, I'll post more.
But in short, MySQL was great when it was the only game in town.
But PostgreSQL has leapfrogged MySQL now in every area including
features, performance, *and* license.  There's no point in starting
a new project with MySQL, *except* for legacy.
 

Mr. Schwartz,
As I stated before, I have a non-trivial amount of admiration for your 
work, but in sounding the death knell for MySQL, I feel you ignore real 
world factors that may make it's use advantageous. First of all is the 
large installed basethe legacy you mentioned. Portability is not a 
small issue.

Secondly, every review or comparison I have read touts MySQL as an 
easier database to learn. Yes, ease of use may come at the expense of a 
larger featureset, but not everyone needs every feature. IMO simplicity 
is a virtue.

Thirdly, you seem to look at MySQL as a dead language, like Latin. Who 
is to say that the next versiom won't leapfrog PostgreSQL in some areas?

Finally, Sir you are dealing with a group that thinks empiracly. Are we 
to take your word that PostgreSQL is faster? Give us some benchmarks. 
Back up your claims with unbiased third party testing.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Any wrong?

2004-06-01 Thread Marcos . Rebelo
 -Original Message-
 From: Jame Brooke [mailto:[EMAIL PROTECTED]
 Sent: Sunday, May 30, 2004 6:10 PM
 To: [EMAIL PROTECTED]
 Subject: Any wrong?
 
 
 
 Friend, anybody have idea regarding this problem. Assume I 
 want know where the  word call fish locate in which line 
 number, and this word i save under file call nlexample. 
 Assume we already know fish save under line number 2, how we 
 show this?  
 
 Example:nlexample 
 
 I love vegetable
 I love fish
 I love perl
 
 
 my script
 ---   
   
 my $lineno;
   
   
 while (){
 if (/pattern/){
 print $lineno++;
 print : $_;
 }
   }
 
 As i know we can use pattern tester to matching right? But 
 why i perl no allow me compiler?
 
 [EMAIL PROTECTED] root]# ./pattern nlexample fish
 Can't open fish: No such file or directory at ./pattern line 
 7,  line 6.
 
 
 Any comment regarding this problem, please advise. 
 
 
 
 
 
 
 -
 Do You Yahoo!?
 Get your free @yahoo.com.hk address at Yahoo! Mail.
 



from 'perldoc perlvar'

 $.  Current line number for the last filehandle accessed.

So You can use this variable to know the line number.

Try something like

use strict;
my $match = shift(@ARGV);
while (defined(my $line = )) {
   print $.$line 
  if $line =~ /$match/;
}

this shall work if you like:

perl script.pl fish fileName.txt

or 

more fileName.txt | perl script.pl fish 


...

Marcos

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Socket IO question

2004-06-01 Thread Jim
Hi
I have 2 simple scripts to send short files from a
win2k box to HP unix box ( for learning purposes only
). They work fine, but I am looking for ideas on why
the client (win2k) needs a sleep statement after each
line write. If I leave it out, I get a Connection
reset by peer on the receiving end(unix)

Thanks and the relative code is below:
-

# Server (Receiver on Unix end)
if ($pid = fork) { # parent   
close(C); 
waitpid( -1, WNOHANG );
next; # ready for another client
} else  {
# child
die can't fork: $! unless defined $pid;
close(S); 
print C Connected to $ip:$port ;
# get file name
sysread(C, $fname, 128)  or die couldn't
read: $!\n;
$fname =~ s/\n//; 
print recieving file: $fname\n;
while ( sysread(C, $buf, 128) ) {
 $msg .= $buf;
}
open (F, $fname) or die couldn't open
it: $!;
# open a new file with the file name and
write to it
print F $msg;
close F;
print Recieved file\n;
exit;
}
--
# client (win2k sender)
socket(SOCK,AF_INET,SOCK_STREAM,$proto) || die $0:
Cannot open socket\n;
connect(SOCK, $remote) or die can't connect: $!\n;
# send filename to server
print sending file $fname\n;
$bytes = syswrite(SOCK, $fname, length($fname));
sleep 1;
open(F, $fname) or die coundn't open: $!;

@buf = F;
foreach $line (@buf) {
# why do we need to sleep ?
 syswrite(SOCK, $line, length($line)) or die can't
write: $!;
 sleep 1;
}
close F;








__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Request Tracker and HTML::FormatText

2004-06-01 Thread Robert Citek
On Saturday, May 29, 2004, at 11:04 US/Central, Roberto Etcheverry 
wrote:

I tried at first with cpan and got the same result as you, don't know
why.
But if you go to CPAN search (seach.cpan.org) and look for
HTML::FormatText in 'modules' you can find it. Try
http://search.cpan.org/search?query=HTML%3A%3AFormatTextmode=module
Too weird.  I tried this the other day and got nothing.
  http://search.cpan.org/search?query=HTML%3A%3AFormatTextmode=all
When I tried it today, it worked.  Probably just a glitch in the 
Matrix.  :)

Muchos gracias por su ayuda, Roberto.
Regards,
- Robert
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



need help

2004-06-01 Thread Sidharth
hi all ,
 i am new to this group and perl world . i hav  a problem in a script where in
i hav to go to the each subdirectory within a directory and creat a temporary file and 
open it for edit. how can i accomplish this ..

thanks in advance
cioa
sidharth





There is nothing in a caterpillar that tells you it's going to be a butterfly.   - 
Anonymous



Re: need help

2004-06-01 Thread Daniel Staal
--As of Tuesday, June 1, 2004 7:55 PM +0530, Sidharth is alleged to have 
said:

hi all ,
 i am new to this group and perl world . i hav  a problem in a script
where in i hav to go to the each subdirectory within a directory and
creat a temporary file and open it for edit. how can i accomplish this ..
--As for the rest, it is mine.
What have you tried?
For a start, I'd look at File::Find and File::Temp.
Daniel T. Staal
---
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Check on array return result

2004-06-01 Thread Tham, Philip
Hi,

The while loop

while(@check_vip_ports)
{

$token=pop(@check_vip_ports);
...


}

It is exiting before traversing the entire array. On running it on debug
I found that a function in the perl library is returning a values which
causes the exit as follows:-

File::Glob::csh_glob(/usr/lib/perl5/5.8.2/sparc-linux/File/Glob.pm:137):
137:my $pat = shift;
  DB11 x $_
0  8256
  DB12 r
scalar context return from File::Glob::csh_glob: undef

Anyone familiar with this situation.

Philip

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Check on array return result

2004-06-01 Thread Wiggins d Anconia
 Hi,
 
 The while loop
 
 while(@check_vip_ports)

In the above you are passing the values in the list @check_vip_ports to
the file globbing operator , which is not likely what you want to be
doing (let us know if it is for sure what you want to do). 

 {
 
 $token=pop(@check_vip_ports);

'pop' also removes the elements from the array which is usually not
necessary, in the case that it is you should probably loop over the
array using indexes instead of the standard 'foreach' idiom, then your
while loop will make a bit more sense.

 ...
 
 
 }
 
 It is exiting before traversing the entire array. On running it on debug
 I found that a function in the perl library is returning a values which
 causes the exit as follows:-
 
 File::Glob::csh_glob(/usr/lib/perl5/5.8.2/sparc-linux/File/Glob.pm:137):
 137:my $pat = shift;
   DB11 x $_
 0  8256
   DB12 r
 scalar context return from File::Glob::csh_glob: undef
 
 Anyone familiar with this situation.
 

See if the common,

foreach my $token (@check_vip_ports) {
  # work on $token here
}

Will work.  If not show us more of what you are doing, what
check_vip_ports contains and what you are doing with $token...

Turn on 'use strict'/'use warnings' if you haven't...

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Check on array return result

2004-06-01 Thread JupiterHost.Net

Tham, Philip wrote:
Hi,
The while loop
while(@check_vip_ports)
{
$token=pop(@check_vip_ports);
...
}
It is exiting before traversing the entire array. On running it on debug
I found that a function in the perl library is returning a values which
causes the exit as follows:-
File::Glob::csh_glob(/usr/lib/perl5/5.8.2/sparc-linux/File/Glob.pm:137):
137:my $pat = shift;
  DB11 x $_
0  8256
  DB12 r
scalar context return from File::Glob::csh_glob: undef
It seems you're probably missing what is actualy happening there. (with 
all the globbing and po()ing ;p) Try this:

for(@check_vip_ports) {
 print \$_ is $_;
}
# just use $_ instead of $token
# or if you *really* want to use $token:
for my $token(@check_vip_ports) {
 print \$token is $token;
}
You may want to
 perldoc -f pop
 perldoc perlop
 perldoc -f glob
HTH :)
Lee.M - JupiterHost.Net
Anyone familiar with this situation.
Philip
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: Check on array return result

2004-06-01 Thread Dennis G. Wicks
Greetings;

I keep getting a warning Use of uninitialized value in
string ... and I can't find a way to eliminate it.

Here is my code and the latest effort.

foreach (FD) {
chomp;
s/^ *//;
($rank, $artist) = split(/ /, $_, 2);
  if ($name{$artist} eq ) {$cnt{$artist} = 0 ; $r{$artist} = 0 }
$r{$artist} = $r{$artist} + $rank;
$cnt{$artist} = $cnt{$artist} + 1;
$name{$artist} = $artist;
print qq($rank, $artist), \n;
print qq($r{$artist}, $cnt{$artist}, $name{$artist}), \n;
}

The line marked  is my latest attempt at solving the
problem. While this does appear to work it still spits out a
warning message for the first record containing a different
$artist. That is what I would like to get rid of, but
programmatically, not be deleting use warnings;

I have a large file of ballots containing the artist's
name and the ranking assigned, 1-500. I want to accumulate
the ranking and count the number of occurrences for each
unique artist to calculate their average ranking and
popularity.

And help appreciated.

Dennis

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Check on array return result

2004-06-01 Thread Wiggins d Anconia
Please group reply so others can help and be helped. Please bottom post.


 I am actually popping out one array element at a time

But do you need to be?

 
 Heres the full code of the loop. This behavior does not happen in all
 the cases which I am comparing. However in cases where it happens it
 does all the time. However if I remove the statement last it does
 traverse the entire loop. However when it prematurely exits the loop the
 condition in the if statement is still false which means that the
 statement last should not be executed. The array contains - 80, 8052,
 8053, 8054, 8055, 8056, 8252,8253,8254,8255,8256.
 In the failure condition the value of $vip_port is 8052. The loop is
 traversed starting with 8256. The loop exits while comparing to 8056.
 
 while(@check_vip_ports){

The problem still has to do with the above use of the . I think you
are getting weird results because of it.


  my $vip_port=pop(@check_vip_ports);
  if($ip_port[1] eq $vip_port){
   $match_found=1;
   last;
  }
 }
 
 

Are you counting on removing the elements from the array? Aka, are you
then using the fact that you have popped off the valid ports from
@check_vip_ports later? How does $match_found used?  Take a couple of
steps back and tell us your overall plan and goal, we may be able to
come up with a better solution, it appears you may want a grep/map/ or
to use a hash.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Check on array return result

2004-06-01 Thread Jeff 'japhy' Pinyan
On Jun 1, Dennis G. Wicks said:

Greetings;

Please start a new thread next time, instead of replying to a post and
creating a new topic.

  foreach (FD) {
chomp;
s/^ *//;
($rank, $artist) = split(/ /, $_, 2);

Those two lines (the s/// and the split) could be rewritten as:

  ($rank, $artist) = split ' ', $_, 2;

The ' ' argument to split() ignores leading and trailing whitespace.

  if ($name{$artist} eq ) {$cnt{$artist} = 0 ; $r{$artist} = 0 }

Simply do:

  if (not exists $name{$artist}) { ... }

The reason you're getting the error is, when the key $artist doesn't exist
in %name, $name{$artist} returns undef, and using undef in a comparison
like '==' or 'eq' gives you the warning message you described.

Using the exists() function is more appropriate here.

$r{$artist} = $r{$artist} + $rank;

  $r{$artist} += $rank;

$cnt{$artist} = $cnt{$artist} + 1;

  ++$cnt{$artist};

$name{$artist} = $artist;
print qq($rank, $artist), \n;
print qq($r{$artist}, $cnt{$artist}, $name{$artist}), \n;

Why don't you include the \n in the qq() strings?  Or, why do you feel the
need to use qq() here when a double-quoted string is fine?

}

You might want to start including 'use strict' in your code; be aware,
though, that this will require you to declare your variables.  Please read
variable scoping documentation to avoid headaches and frustration.

-- 
Jeff japhy Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
CPAN ID: PINYAN[Need a programmer?  If you like my work, let me know.]
stu what does y/// stand for?  tenderpuss why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Loading Scalar Vars with Text - Readability

2004-06-01 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, 
   Adding Perl to the list of languages... and came across a question of
loading vars with very long strings...

   Actually I am modifiying a prior employee's code and want to make it
more readable.

currently the code is such:
my $longlist = Clause1|Clause2|Clause3|Clause4|...|ClauseN;

I would like to know why I can't make this more readable?  Is it because
newline characters would be added to the mix?  I would like to do
something like this:

my $longlist = Clause1|
Clause2|
Clause3|
Clause4|
...|
ClauseN;

Please copy me directly on your response.  T

Thanks,
Art Bahrs
[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Loading Scalar Vars with Text - Readability

2004-06-01 Thread Wiggins d Anconia
 Hi, 
Adding Perl to the list of languages... and came across a question of
 loading vars with very long strings...
 
Actually I am modifiying a prior employee's code and want to make it
 more readable.
 
 currently the code is such:
 my $longlist = Clause1|Clause2|Clause3|Clause4|...|ClauseN;
 
 I would like to know why I can't make this more readable?  Is it because
 newline characters would be added to the mix?  I would like to do
 something like this:
 
 my $longlist = Clause1|
 Clause2|
 Clause3|
 Clause4|
 ...|
 ClauseN;
 

Depends on how the variable is then used. Because it is a quoted string
newlines and lots of whitespace is added to the string, which will
likely then throw off other formatting or parsing of the string.  If you
want you could put the clauses into an array quoting them separately
then just 'join' to build the $longlist.  This would be one way to
improve readability through formatting. Using constants, loading the
values from a config file automatically, etc. might be other ways. 

To me as long as there isn't anything else going on further down the
line it isn't unreadable.  For those in legacy editors/terminals they
would disagree I suppose...

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Unitialized variable; was Re: Check on array return result

2004-06-01 Thread Dennis G. Wicks
On Tue, 1 Jun 2004, Jeff 'japhy' Pinyan wrote:

 On Jun 1, Dennis G. Wicks said:

 Greetings;

 Please start a new thread next time, instead of replying to a post and
 creating a new topic.

OK, so I screwed up. Mea culpa!


   foreach (FD) {
 chomp;
 s/^ *//;
 ($rank, $artist) = split(/ /, $_, 2);

 Those two lines (the s/// and the split) could be rewritten as:

   ($rank, $artist) = split ' ', $_, 2;

 The ' ' argument to split() ignores leading and trailing whitespace.

Thanks for the tip. I develop stepwise. The s/^ *//; came
about because I encountered some records that had leading
spaces, and right now If it works, don't f*** with it!.

   if ($name{$artist} eq ) {$cnt{$artist} = 0 ; $r{$artist} = 0 }

 Simply do:

   if (not exists $name{$artist}) { ... }

Alright! That's what I was looking for! Works great!


 The reason you're getting the error is, when the key $artist doesn't exist
 in %name, $name{$artist} returns undef, and using undef in a comparison
 like '==' or 'eq' gives you the warning message you described.

 Using the exists() function is more appropriate here.

 $r{$artist} = $r{$artist} + $rank;

   $r{$artist} += $rank;

 $cnt{$artist} = $cnt{$artist} + 1;

   ++$cnt{$artist};
 Yeah, I originally had code like you suggest, but I was
getting the bad error messages and I thought I could fool it
somehow.


 $name{$artist} = $artist;
 print qq($rank, $artist), \n;
 print qq($r{$artist}, $cnt{$artist}, $name{$artist}), \n;

 Why don't you include the \n in the qq() strings?  Or, why do you feel the
 need to use qq() here when a double-quoted string is fine?

 }

 You might want to start including 'use strict' in your code; be aware,
 though, that this will require you to declare your variables.  Please read
 variable scoping documentation to avoid headaches and frustration.
I do use ... this is just a snippet and the headers,

#!/usr/bin/perl
use diagnostics;
use warnings;
use strict;

are way above the code in question.

Thanks for the help and the tips!
Dennis



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Loading Scalar Vars with Text - Readability

2004-06-01 Thread James Edward Gray II
On Jun 1, 2004, at 2:16 PM, PerlDiscuss - Perl Newsgroups and mailing 
lists wrote:

Hi,
   Adding Perl to the list of languages... and came across a question 
of
loading vars with very long strings...

   Actually I am modifiying a prior employee's code and want to make it
more readable.
currently the code is such:
my $longlist = Clause1|Clause2|Clause3|Clause4|...|ClauseN;
I would like to know why I can't make this more readable?  Is it 
because
newline characters would be added to the mix?  I would like to do
something like this:

my $longlist = Clause1|
Clause2|
Clause3|
Clause4|
...|
ClauseN;
Please copy me directly on your response.  T
I would use:
my $longlist = Clause1| .
Clause2| .
# ...
ClauseN;
And yes, the reason you can't put a newline character in the string is 
because it would take it literally.

James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Loading Scalar Vars with Text - Readability

2004-06-01 Thread Hanson, Rob
You could do create the string then strip the space.  I think there was
something in the Perl Cookbook that was similar to this.

my $longlist = no_space(END_OF_LIST);
Clause1|
Clause2|
Clause3|
Clause4
END_OF_LIST

print $longlist;


sub no_space
{
  my $txt = shift;
  $txt =~ s/^\s+//;
  $txt =~ s/\s*\n\s*//sg;
  $txt =~ s/\s+$//;
  return $txt;
}

Rob

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 01, 2004 3:16 PM
To: [EMAIL PROTECTED]
Subject: Loading Scalar Vars with Text - Readability


Hi, 
   Adding Perl to the list of languages... and came across a question of
loading vars with very long strings...

   Actually I am modifiying a prior employee's code and want to make it
more readable.

currently the code is such:
my $longlist = Clause1|Clause2|Clause3|Clause4|...|ClauseN;

I would like to know why I can't make this more readable?  Is it because
newline characters would be added to the mix?  I would like to do
something like this:

my $longlist = Clause1|
Clause2|
Clause3|
Clause4|
...|
ClauseN;

Please copy me directly on your response.  T

Thanks,
Art Bahrs
[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




I am looking for PERL coder from Romania, Bulgaria, Russia or India

2004-06-01 Thread Maxipoint Rep Office
I am looking for PERL coder from Romania, Bulgaria, Russia or India for long
terms relationship. I have not large budget but I wish work with same coder
on few bids. Coder must have STRONG PERL and mod_perl experience.

I have some computer qnowledge and I wish learn during bids. Same coder who
win this bid, have from me additional educational set of 12 bids (12 months
x $25/per month for my mod_perl education).


My bid is active on https://www.rentacoder.com web site with name: 'Perl web
education more advanced details' and you can send your bid offer.

I have by Rent a Coder still one bid active: 'Anti spam script'


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: I am looking for PERL coder from Romania, Bulgaria, Russia or India

2004-06-01 Thread James Edward Gray II
On Jun 1, 2004, at 8:07 PM, Maxipoint Rep Office wrote:
I am looking for PERL coder from Romania, Bulgaria, Russia or India 
for long
terms relationship.
Then look in the right place.  ;)  Somewhere like:
http://jobs.perl.org/
This is a mailing list where beginners can ask questions and get help 
with their code.  That makes you more than a little off topic.

When you do post to a more appropriate place, remember that we spell 
the language Perl, not PERL.  It should score you some points.

Good luck with your search.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response