[24975] in Perl-Users-Digest
Perl-Users Digest, Issue: 7225 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 8 21:07:07 2004
Date: Fri, 8 Oct 2004 18:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 8 Oct 2004 Volume: 10 Number: 7225
Today's topics:
[newbie] Problems with character output. <reven.quita.esto@reven.y.esto.tambien.org>
Re: Accessing hashes and converting into an array <dwall@fastmail.fm>
Re: Accessing hashes and converting into an array <tadmc@augustmail.com>
Re: Asking for the question for DBI for MS SQL Server <usenet@morrow.me.uk>
Re: DBI selectall_hashref <usenet@morrow.me.uk>
Getting all directories/files from current directory an (Adam Petrie)
Re: Getting all directories/files from current director <dwall@fastmail.fm>
Re: Getting all directories/files from current director <tim@vegeta.ath.cx>
Re: Getting all directories/files from current director (Jay Tilton)
Re: Getting all directories/files from current director <tadmc@augustmail.com>
Re: Getting all directories/files from current director <umeshmnair@gmail.com>
How do I Capitalize the first letter? <nntp@rogers.com>
Re: How do I Capitalize the first letter? <jkeen_via_google@yahoo.com>
Re: How do I Capitalize the first letter? <mritty@gmail.com>
Re: How do I Capitalize the first letter? <mritty@gmail.com>
Re: How do I Capitalize the first letter? <tadmc@augustmail.com>
Re: How do I merge two arrays or two strings? (Jay Tilton)
How to capture output of CVS via Perl? (Chris Weiss)
How to capture output of CVS via Perl? (Chris Weiss)
Re: How to capture output of CVS via Perl? <postmaster@castleamber.com>
Re: How to capture output of CVS via Perl? <postmaster@castleamber.com>
Re: How to capture output of CVS via Perl? <mritty@gmail.com>
Re: How to capture output of CVS via Perl? <usenet@morrow.me.uk>
Re: How to capture output of CVS via Perl? <tadmc@augustmail.com>
Re: linked list for string class ctcgag@hotmail.com
Re: linked list for string class <bik.mido@tiscalinet.it>
Re: linked list for string class (Anno Siegel)
Re: linked list for string class <dwall@fastmail.fm>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 09 Oct 2004 01:31:16 +0200
From: Reven <reven.quita.esto@reven.y.esto.tambien.org>
Subject: [newbie] Problems with character output.
Message-Id: <8rF9d.6586$pl1.6396@twister.auna.com>
Hi group.
I've installed ActivePerl on win XP and I'm having some problems. I've
tried documentation at activestate but found nothing on this topic.
When a string contains a non-english character (for ex. á [thats
á if you don't see it]) and the script prints that string to the
screen, I get a lousy character, like if the cmd shell didn't support
this character. But I can type it directly in a shell prompt and it
shows ok.
I've tried playing with locale (use locale;) and perl uses es_es (that's
my system's locale, aka es_ES.1252), so those character should print
out. Windows local is also set to Spanish.
I tried "use utf8;", "use iso-8859-1;" and "use latin1;" to no avail.
With utf-8 I get a whole lot of warnings and instead of weird chars I
get a blank space.
I've also tried encoding my strings:
#!c:/perl/bin/perl.exe
use Encode;
$u = "á"; # The value of this string is an "a" acute
$s = decode("latin1", $u);
print $s, "\n";
gives no result. Instead of an "a tilde" I get a Greek Beta. I've also
tried "iso-8859-1" and "windows-1252", but to the same effect. I'm quite
lost. This is just a wild guess: could there be any problem with the
console itself? Could I be *so* lucky to find a bug?
I'd really appreciate any help on this.
Reven.
------------------------------
Date: Fri, 08 Oct 2004 20:51:42 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Accessing hashes and converting into an array
Message-Id: <Xns957CAB8682525dkwwashere@216.168.3.30>
<ctcgag@hotmail.com> wrote:
> rohit.satabhai@bt.com (Rohit S) wrote:
>> I need a report o/p in the following format and
>> displayed in HTML
>
> What is o/p?
It's a who: Andy Taylor's son, of course.
------------------------------
Date: Fri, 8 Oct 2004 20:03:02 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Accessing hashes and converting into an array
Message-Id: <slrncmee66.740.tadmc@magna.augustmail.com>
David K. Wall <dwall@fastmail.fm> wrote:
> <ctcgag@hotmail.com> wrote:
>> rohit.satabhai@bt.com (Rohit S) wrote:
>
>>> I need a report o/p in the following format and
>>> displayed in HTML
>>
>> What is o/p?
>
> It's a who: Andy Taylor's son, of course.
That may bery well be who he meant.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 8 Oct 2004 23:18:18 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Asking for the question for DBI for MS SQL Server
Message-Id: <aagj32-756.ln1@osiris.mauzo.dyndns.org>
Quoth mxu28@yahoo.com (mxu28@yahoo.com):
> Is there any one know the parameters for the DBI connect for Ms SQL
> Servwe 2000? or any samples?
If you are running perl on Win32, use DBD::OBDC; otherwise use
DBD::Sybase (MSSQL is very closely based on Sybase and uses the same
protocol).
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: Sat, 9 Oct 2004 00:42:19 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: DBI selectall_hashref
Message-Id: <r7lj32-q67.ln1@osiris.mauzo.dyndns.org>
Quoth "Jeff" <jeff.gilbertson@gmail.com>:
> I'm having issues with selectall_hashref. Here's my code:
Others have dealt with your problems... these are just a few comments.
> #!/usr/bin/perl
>
use warnings;
use strict;
> use DBI;
> use Data::Dumper;
I prefer Data::Dump, as I find its interface less confusing :).
> # Connect to database
> $dbh=DBI->connect("dbi:Sybase:server=$Server",$User,$Pass) || die
> "$DBI::errstr\n";
In general use 'or' not '||' for flow control: it has low precedence so
statements like
open my $H, '<', $file or die $!;
don't need parenthesising.
Also, if you put "\n" on the end of a die message it won't tell you
where the error was, so don't do that (at least, don't for messages
meant for 'the developer'. Do for messages meant for 'the user': in
which case they need to be a little more comprehensible than just a bare
$DBI::errstr).
> # Read from database
> $SQL="
> SELECT
> CallID,PlannedDate,PlannedTime,Solution,Status,DevApprov,qaApprvl,whoApprvdDev,whoApprvdQA
> FROM heat.Detail WHERE PlannedDate = '2004-10-06'
> ";
> $Results = $dbh->selectall_hashref("$SQL","callid");
I would suggest using a here-doc here; I would also suggest using
prepared statements and bind values (although in this particular case
there are no issues with quoting, it is a good habit to get into).
Also SQL lower-cases all identifiers, so there's no need for all those
silly caps.
So we have
my $Results =
$dbh->selectall_hashref(<<SQL, 'callid', undef, '2004-10-06');
SELECT callid, planneddate, plannedtime, solution, status,
devapprov, qaapprvl, whoapprvddev, whoapprvdqa
FROM heat.detail
WHERE planneddate = ?
SQL
> # Disconnect from database
> $dbh->disconnect();
Assuming you have called your database handle something sensible (like
$dbh), this comment adds precisely nothing to the line of code below it.
Save comments for when you *do* need to explain something.
Ben
--
I must not fear. Fear is the mind-killer. I will face my fear and
I will let it pass through me. When the fear is gone there will be
nothing. Only I will remain.
ben@morrow.me.uk Frank Herbert, 'Dune'
------------------------------
Date: 8 Oct 2004 13:05:10 -0700
From: adam.petrie@walgreens.com (Adam Petrie)
Subject: Getting all directories/files from current directory and using -d flag for the directories
Message-Id: <9d42ced3.0410081205.7c9fec80@posting.google.com>
Hi guys/gals,
I'm pretty new to Perl, so please keep that in mind. :)
It looks like File::Find goes through all the subdirectories of the
current directory, which isn't what I want. I just want all the
contents of the current directory.
On doing some research, many people have recommended doing something
like the following:
-----------
$home_dir = ''; #changed to protect the innocent :)
opendir(DIR,$home_dir) or die "Can't open the current directory:
$home_dir $!\n";
# read file/directory names in that directory into @names
@names = readdir(DIR) or die "Unable to read current dir:$!\n";
closedir(DIR);
foreach $name (@names) {
next if ($name eq "."); # skip the current directory entry
next if ($name eq ".."); # skip the parent directory entry
if (-d $name){ # is this a directory?
print "found a directory: $name<br />";
}
else {
print "found a file: $name <br />";
}
}
-----------
However, the -d doesn't seem to be working right. Most of the output
comes from the else part when it should be showing many directories
instead.
What is going on? Any other solutions?
------------------------------
Date: Fri, 08 Oct 2004 20:55:17 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Getting all directories/files from current directory and using -d flag for the directories
Message-Id: <Xns957CAC22BE023dkwwashere@216.168.3.30>
Adam Petrie <adam.petrie@walgreens.com> wrote:
> $home_dir = ''; #changed to protect the innocent :)
>
> opendir(DIR,$home_dir) or die "Can't open the current directory:
> $home_dir $!\n";
>
> # read file/directory names in that directory into @names
> @names = readdir(DIR) or die "Unable to read current dir:$!\n";
>
> closedir(DIR);
>
> foreach $name (@names) {
> next if ($name eq "."); # skip the current directory entry
> next if ($name eq ".."); # skip the parent directory entry
>
> if (-d $name){ # is this a directory?
> print "found a directory: $name<br />";
> }
> else {
> print "found a file: $name <br />";
> }
>}
> -----------
> However, the -d doesn't seem to be working right. Most of the
> output comes from the else part when it should be showing many
> directories instead.
>
> What is going on? Any other solutions?
Maybe your program's default directory while executing is not what
you think it is? The chdir function could be useful in that case.
------------------------------
Date: Fri, 08 Oct 2004 22:07:55 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Getting all directories/files from current directory and using -d flag for the directories
Message-Id: <slrncme3o7.pg6.tim@vegeta.saiyix>
Adam Petrie <adam.petrie@walgreens.com> wrote:
> On doing some research, many people have recommended doing something
> like the following:
> -----------
> $home_dir = ''; #changed to protect the innocent :)
>
> opendir(DIR,$home_dir) or die "Can't open the current directory:
> $home_dir $!\n";
>
> # read file/directory names in that directory into @names
> @names = readdir(DIR) or die "Unable to read current dir:$!\n";
>
> closedir(DIR);
>
> foreach $name (@names) {
> next if ($name eq "."); # skip the current directory entry
> next if ($name eq ".."); # skip the parent directory entry
>
> if (-d $name){ # is this a directory?
> print "found a directory: $name<br />";
> }
> else {
> print "found a file: $name <br />";
> }
> }
> -----------
> However, the -d doesn't seem to be working right. Most of the output
> comes from the else part when it should be showing many directories
> instead.
Assuming the directory structure:
/data <- directory where you're looking for file/dirs
/bin <- directory where your script is located
/other <- another directory where your script is called *from*
and $home_dir is set to "/data", then the directories and files returned
by readdir() will be in /data. However, when you do the -d test, the
test is performed relative to the directory from which the script is
executed ("/other") and so is checking whether /other/somefile is
a directory, rather than /data/somefile, as you intend.
Just prefix $user_dir onto $name and test that way:
: foreach $name (@names) {
: next if ($name eq "."); # skip the current directory entry
: next if ($name eq ".."); # skip the parent directory entry
:
: $name = "$home_dir/$name";
: if (-d $name){ # is this a directory?
: print "found a directory: $name<br />";
: }
: else {
: print "found a file: $name <br />";
: }
: }
Oh, and remember to use strict;
HTH,
Tim Hammerquist
------------------------------
Date: Fri, 08 Oct 2004 22:09:54 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Getting all directories/files from current directory and using -d flag for the directories
Message-Id: <41670ec1.160418619@news.erols.com>
adam.petrie@walgreens.com (Adam Petrie) wrote:
: $home_dir = ''; #changed to protect the innocent :)
:
: opendir(DIR,$home_dir) or die "Can't open the current directory:
: $home_dir $!\n";
:
: # read file/directory names in that directory into @names
: @names = readdir(DIR) or die "Unable to read current dir:$!\n";
:
: closedir(DIR);
:
: foreach $name (@names) {
: next if ($name eq "."); # skip the current directory entry
: next if ($name eq ".."); # skip the parent directory entry
:
: if (-d $name){ # is this a directory?
Better question: Does $name contain the path to the directory that was
opened and readdir()ed earlier?
Answer: Nope.
use File::Spec::Functions qw(catfile);
if (-d catfile($home_dir, $name) ) {
: print "found a directory: $name<br />";
: }
: else {
: print "found a file: $name <br />";
: }
: }
------------------------------
Date: Fri, 8 Oct 2004 18:41:27 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Getting all directories/files from current directory and using -d flag for the directories
Message-Id: <slrncme9d7.740.tadmc@magna.augustmail.com>
Adam Petrie <adam.petrie@walgreens.com> wrote:
> I'm pretty new to Perl, so please keep that in mind. :)
The docs that come with perl are a great resource.
You should become accustomed to looking at them as a *first*
step in troubleshooting.
> opendir(DIR,$home_dir) or die "Can't open the current directory:
> $home_dir $!\n";
>
> # read file/directory names in that directory into @names
> @names = readdir(DIR) or die "Unable to read current dir:$!\n";
perldoc -f readdir
anticipates the very problem you are having.
Your problem could have been solved in about 20 seconds by
using the docs...
> if (-d $name){ # is this a directory?
If you're planning to filetest the return values out of a
"readdir", you'd better prepend the directory in question.
Otherwise, because we didn't "chdir" there, it would have been
testing the wrong file.
> What is going on?
You are using a function without having read its documentation.
This is the programming equivalent of signing a contract without
reading it first. Very dangerous!
> Any other solutions?
Read the documentation for the functions that you use.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 08 Oct 2004 13:37:57 -0700
From: Umesh Nair <umeshmnair@gmail.com>
To: Adam Petrie <adam.petrie@walgreens.com>
Subject: Re: Getting all directories/files from current directory and using -d flag for the directories
Message-Id: <4166FAA5.9030404@gmail.com>
Adam Petrie wrote:
> Hi guys/gals,
>
> I'm pretty new to Perl, so please keep that in mind. :)
>
> It looks like File::Find goes through all the subdirectories of the
> current directory, which isn't what I want. I just want all the
> contents of the current directory.
>
You might want to use the very convenient File::Finder module from CPAN.
use File::Finder;
my @array = File::Finder->type('f')->in($dir_loc);
------------------------------
Date: Fri, 8 Oct 2004 17:54:42 -0400
From: "nntp" <nntp@rogers.com>
Subject: How do I Capitalize the first letter?
Message-Id: <VY2dnR2IneIikfrcRVn-jw@rogers.com>
s/\s(\w)//g;
how to inclue the fist letter in too?
I want to make
abc xyz to Abc Xyz
------------------------------
Date: Fri, 08 Oct 2004 22:23:32 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: How do I Capitalize the first letter?
Message-Id: <ErE9d.2303$715.1725@trndny02>
nntp wrote:
> s/\s(\w)//g;
> how to inclue the fist letter in too?
>
> I want to make
> abc xyz to Abc Xyz
>
>
perldoc -f ucfirst
------------------------------
Date: Fri, 08 Oct 2004 20:02:34 -0400
From: Paul Lalli <mritty@gmail.com>
To: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: How do I Capitalize the first letter?
Message-Id: <41672A9A.6040207@gmail.com>
Jim Keenan wrote:
> nntp wrote:
>
>> s/\s(\w)//g;
>> how to inclue the fist letter in too?
>>
>> I want to make
>> abc xyz to Abc Xyz
>>
>>
> perldoc -f ucfirst
Have you yourself read that documentation? It doesn't do what the OP
asked for.
Paul Lalli
------------------------------
Date: Fri, 08 Oct 2004 20:07:55 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: How do I Capitalize the first letter?
Message-Id: <ck7a58$jbv$1@misc-cct.server.rpi.edu>
nntp wrote:
> s/\s(\w)//g;
this is elminating the space and word character. That doesn't at all
match your subject.
> how to inclue the fist letter in too?
>
> I want to make
> abc xyz to Abc Xyz
>
>
\s is searching for a space. You just want to find the first character
in each 'word'. Assuming you don't mind Perl's default definition of
'word' characters (which include digits and underscores), you're going
to want something closer to this:
s/\b(\w)/\u$1/g;
read perldoc perlre for info on \b. Read perldoc -f ucfirst for info on \u
HOWEVER, this will not function as you intend for several phrases. One
obvious example is:
"this won't work", which would become "This Won'T Work".
So perhaps you might actually want to look for the space, but also
inclue the very first character in the string:
s/(^|\s)(\w)/$1\u$2/g;
Paul Lalli
------------------------------
Date: Fri, 8 Oct 2004 18:43:18 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How do I Capitalize the first letter?
Message-Id: <slrncme9gm.740.tadmc@magna.augustmail.com>
nntp <nntp@rogers.com> wrote:
> I want to make
> abc xyz to Abc Xyz
s/(\w+)/\u\L$1/g; # untested
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 08 Oct 2004 21:28:01 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: How do I merge two arrays or two strings?
Message-Id: <41670656.158263671@news.erols.com>
"nntp" <nntp@rogers.com> wrote:
: Let's say I have two arrays, one has N elements and the other has M. Both N
: and M vary. I want to merge the two like you shuffle two decks of cards.
: from
: 1 2 3 4 5 6 7 8
: a b c d e f g h
: to
: 12a34bc5def78gh
:
#!perl
use strict;
use warnings;
use List::Util 'shuffle';
my @a = qw(1 2 3 4 5 6 7 8);
my @b = qw(a b c d e f g h);
my @c = map shift @{[\(@a, @b)]->[$_]}, shuffle( (0) x @a, (1) x @b );
__END__
------------------------------
Date: 8 Oct 2004 14:29:07 -0700
From: cweiss@stickyc.com (Chris Weiss)
Subject: How to capture output of CVS via Perl?
Message-Id: <653ab165.0410081329.168fb685@posting.google.com>
I'm trying to capture the output of a cvs update session to a log file
using ActivePerl and can't seem to get it captured - the CVS results
still dump to the screen and not to a file...
Here's the snippit of code I'm trying:
open(STDOUT, ">".$logfile);
system($cvs." ".$cvsroot." ".$cvs_update_args);
Any thoughts on what's going on? Does ActivePerl not support SDTOUT?
Any help would be greatly appreciated!
------------------------------
Date: 8 Oct 2004 14:44:32 -0700
From: cweiss@stickyc.com (Chris Weiss)
Subject: How to capture output of CVS via Perl?
Message-Id: <653ab165.0410081344.2a908ee9@posting.google.com>
I'm trying to capture the output of a cvs update session to a log file
using ActivePerl and can't seem to get it captured - the CVS results
still dump to the screen and not to a file...
Here's the snippit of code I'm trying:
open(STDOUT, ">".$logfile);
system($cvs." ".$cvsroot." ".$cvs_update_args);
Any thoughts on what's going on? Does ActivePerl not support SDTOUT?
Any help would be greatly appreciated!
------------------------------
Date: 8 Oct 2004 22:57:06 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: How to capture output of CVS via Perl?
Message-Id: <Xns957CB6933D8CFcastleamber@130.133.1.4>
cweiss@stickyc.com (Chris Weiss) wrote in news:653ab165.0410081329.168fb685
@posting.google.com:
> I'm trying to capture the output of a cvs update session to a log file
> using ActivePerl and can't seem to get it captured - the CVS results
> still dump to the screen and not to a file...
>
> Here's the snippit of code I'm trying:
>
> open(STDOUT, ">".$logfile);
> system($cvs." ".$cvsroot." ".$cvs_update_args);
perldoc -f system
also, you don't need that weird . stuff, you know Perl can perfectly
interpolate strings?
"$cvs $cvsroot $cvs_update_args"
> Any thoughts on what's going on? Does ActivePerl not support SDTOUT?
Sure it does.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: 8 Oct 2004 22:57:39 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: How to capture output of CVS via Perl?
Message-Id: <Xns957CB6AAE6FF0castleamber@130.133.1.4>
cweiss@stickyc.com (Chris Weiss) wrote in news:653ab165.0410081344.2a908ee9
@posting.google.com:
Google doesn't show up your message immediatly, no need to post it again.
Just wait.
--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
------------------------------
Date: Fri, 08 Oct 2004 20:00:20 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: How to capture output of CVS via Perl?
Message-Id: <ck79n2$j7l$1@misc-cct.server.rpi.edu>
Chris Weiss wrote:
> I'm trying to capture the output of a cvs update session to a log file
> using ActivePerl and can't seem to get it captured - the CVS results
> still dump to the screen and not to a file...
>
> Here's the snippit of code I'm trying:
>
> open(STDOUT, ">".$logfile);
Always check the return value of open.
> system($cvs." ".$cvsroot." ".$cvs_update_args);
You're not even bothering to determine if this command ran successfully.
> Any thoughts on what's going on?
Yes. You have a misperception about the cvs command.
> Does ActivePerl not support SDTOUT?
I've never heard of any language supporting SDTOUT. STDOUT, on the
other hand...
> Any help would be greatly appreciated!
Forget perl for a moment. Try this command in your shell:
cvs update > output.txt 2> err.txt
The results of that should point you in the right direction.
Paul Lalli
------------------------------
Date: Sat, 9 Oct 2004 01:06:04 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to capture output of CVS via Perl?
Message-Id: <ckmj32-q67.ln1@osiris.mauzo.dyndns.org>
Quoth cweiss@stickyc.com (Chris Weiss):
> I'm trying to capture the output of a cvs update session to a log file
> using ActivePerl and can't seem to get it captured - the CVS results
> still dump to the screen and not to a file...
>
> Here's the snippit of code I'm trying:
>
> open(STDOUT, ">".$logfile);
> system($cvs." ".$cvsroot." ".$cvs_update_args);
Under Win2k or later
system "$cvs $cvsroot $cvs_update_args > $logfile 2>&1";
Under earlier windows versions the only thing I've ever found to work is
mucking about with Win32::Process, which is Highly Unpleasant.
Ben
--
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/' # ben@morrow.me.uk
------------------------------
Date: Fri, 8 Oct 2004 18:45:55 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to capture output of CVS via Perl?
Message-Id: <slrncme9lj.740.tadmc@magna.augustmail.com>
Chris Weiss <cweiss@stickyc.com> wrote:
> open(STDOUT, ">".$logfile);
> Any help would be greatly appreciated!
You should always, yes *always*, test the return value from open():
open(STDOUT, ">$logfile") or die "could not open '$logfile' $!";
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 08 Oct 2004 18:09:48 GMT
From: ctcgag@hotmail.com
Subject: Re: linked list for string class
Message-Id: <20041008140948.115$V3@newsreader.com>
larry_wallet@yahoo.com wrote:
> > I'm curious to know what the limitations of common strings are and how
> > your string class overcomes them.
> >
> > --Ala
>
> You are right, I did not explain clearly the benefits. Strings as
> they are are made up of dead characters. Characters with no life, no
> awareness, no sense of purpose, no knowledge of where they are and who
> surrounds them.
Do you give motivational seminars for ASCII characters?
> Imagine a string of characters in which each character is of a
> different class, derived from the same class of course, and each knows
> its place in the string yet cooperates with its fellow characters in
> ways that we can only dream of.
OK, I'm thinking of a godawful mess. When I'm typing up my thesis, the
last thing I want is for all the "the"s to make a coalition with all the
"adenosine"s and then jointly declare war upon any word ending with "-gen"
or "-ome".
If the characters are no longer characters but now fully sentient beings,
then I would say you no longer have a string, becuase that is not what
"string" means when programmers use that word.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Fri, 08 Oct 2004 22:04:25 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: linked list for string class
Message-Id: <cirdm057on31huk977ath7nch7vvcmmipp@4ax.com>
On 8 Oct 2004 05:09:51 -0700, larry_wallet@yahoo.com wrote:
>Imagine a string of characters in which each character is of a
>different class, derived from the same class of course, and each knows
>its place in the string yet cooperates with its fellow characters in
>ways that we can only dream of. This leads to technology like
>self-correcting strings, intelligent documents, and even interactive,
>multitasking text. The benefits are basically issues of encapsulation
>and extensibility.
Are you sure you want to do this in *Perl*?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 8 Oct 2004 20:17:46 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: linked list for string class
Message-Id: <ck6sla$f55$2@mamenchi.zrz.TU-Berlin.DE>
Michele Dondi <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> On 8 Oct 2004 05:09:51 -0700, larry_wallet@yahoo.com wrote:
>
> >Imagine a string of characters in which each character is of a
> >different class, derived from the same class of course, and each knows
> >its place in the string yet cooperates with its fellow characters in
> >ways that we can only dream of. This leads to technology like
> >self-correcting strings, intelligent documents, and even interactive,
> >multitasking text. The benefits are basically issues of encapsulation
> >and extensibility.
>
> Are you sure you want to do this in *Perl*?
I think we have been trolled, though not very effectively. I mean,
larry_wallet@yahoo...
Anno
------------------------------
Date: Fri, 08 Oct 2004 20:59:40 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: linked list for string class
Message-Id: <Xns957CACE071123dkwwashere@216.168.3.30>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> I think we have been trolled, though not very effectively. I
> mean, larry_wallet@yahoo...
Possibly, but Xho's response was worth it. :-)
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 7225
***************************************