[29140] in Perl-Users-Digest
Perl-Users Digest, Issue: 384 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 26 18:09:46 2007
Date: Thu, 26 Apr 2007 15:09:04 -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 Thu, 26 Apr 2007 Volume: 11 Number: 384
Today's topics:
Re: Any Help? Stuck trying to create cgi perl program shadkeene@hotmail.com
Cat file a to *.xls files <grace.jim@gmail.com>
Re: Cat file a to *.xls files <wahab-mail@gmx.de>
Re: Cat file a to *.xls files <tadmc@augustmail.com>
Correlating Data from same .csv, line by line shadkeene@hotmail.com
Correlating Data from same .csv, line by line shadkeene@hotmail.com
Re: Correlating Data from same .csv, line by line <1usa@llenroc.ude.invalid>
Re: Correlating Data from same .csv, line by line <glex_no-spam@qwest-spam-no.invalid>
Re: Determining difference from Vista32 and Vista64 <purlgurl@purlgurl.net>
Re: Determining difference from Vista32 and Vista64 <purlgurl@purlgurl.net>
Re: Determining difference from Vista32 and Vista64 <spamtrap@dot-app.org>
Re: FAQ 4.32 How do I strip blank space from the beginn <bart.lateur@pandora.be>
Re: Readable/writable database in Perl xhoster@gmail.com
Re: Readable/writable database in Perl <nobull67@gmail.com>
Re: Readable/writable database in Perl <ecarlson@vmware.com>
Re: SQL statement in Perl doesn't work <"v.niekerk at hccnet.nl">
Re: SQL statement in Perl doesn't work <glex_no-spam@qwest-spam-no.invalid>
Re: SQL statement in Perl doesn't work <glennj@ncf.ca>
Re: STDOUT redirection paraagv@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Apr 2007 12:12:49 -0700
From: shadkeene@hotmail.com
Subject: Re: Any Help? Stuck trying to create cgi perl program
Message-Id: <1177614769.748027.107800@u32g2000prd.googlegroups.com>
Thanks for your help...I have it working now...
Shad
------------------------------
Date: 26 Apr 2007 13:30:08 -0700
From: Jim <grace.jim@gmail.com>
Subject: Cat file a to *.xls files
Message-Id: <1177619408.560095.119400@o40g2000prh.googlegroups.com>
Hi I'm trying to get a perl script to work without much luck.
What I'm trying to do is to:
cat filea.txt to all .xls files in a directory
your help would be appreciated
Thanks in advance
------------------------------
Date: Thu, 26 Apr 2007 22:48:32 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: Cat file a to *.xls files
Message-Id: <f0r3hb$e1g$1@mlucom4.urz.uni-halle.de>
Jim wrote:
> Hi I'm trying to get a perl script to work without much luck.
> What I'm trying to do is to:
> cat filea.txt to all .xls files in a directory
Are you Jim the Italian living in French
Canada trying to write English?
(I didn't understand anything)
What's meant by 'cat' here? Can you explain?
Regards
M.
------------------------------
Date: Thu, 26 Apr 2007 17:54:51 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Cat file a to *.xls files
Message-Id: <slrnf32bdr.du2.tadmc@tadmc30.august.net>
Jim <grace.jim@gmail.com> wrote:
> Hi I'm trying to get a perl script to work without much luck.
>
> What I'm trying to do is to:
>
> cat filea.txt to all .xls files in a directory
>
> your help would be appreciated
No Perl needed, just use the shell!
# untested
for file in *.xls; do
cat filea.txt >>$file
done
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Apr 2007 12:30:26 -0700
From: shadkeene@hotmail.com
Subject: Correlating Data from same .csv, line by line
Message-Id: <1177615826.742871.288080@o40g2000prh.googlegroups.com>
Hi,
Here's a complete but minimal example of what I'm doing with a .csv
file (each line in the .csv file corresponds to a certain date).
I'm reading the file and printing out simple statistics for the data
using the grep command. However, I'd like to go a step further and
print the date if a certain thing (or combination of things) occurred
on that day. (i.e. if checkboxes WF and CF were checked...print the
date that they were checked).
My desperate but not functional attempt to correlate the values, line
by line, and place in an array is at the bottom.
open(FH, "C:/perl-scripts/Data/coldseasonworksheet.csv")
or &dienice("couldn't open output file: $!");
seek(FH, 0, SEEK_SET); #goes to beginning of file
my @data = <FH>; #reads file and places in array
close(FH);
my @ETresults = grep(/ET,/, @data);
my $ETnum = @ETresults;
Exiting Troughs this year=$ETnum. <br>
#my @output = (); ###attempt...tried to use "and", "||" so the "||"
would be read first.
#push @output, param('DATE') and param('WF') || param('CF') for
@fields;
------------------------------
Date: 26 Apr 2007 12:30:53 -0700
From: shadkeene@hotmail.com
Subject: Correlating Data from same .csv, line by line
Message-Id: <1177615853.024155.289010@o40g2000prh.googlegroups.com>
Hi,
Here's a complete but minimal example of what I'm doing with a .csv
file (each line in the .csv file corresponds to a certain date).
I'm reading the file and printing out simple statistics for the data
using the grep command. However, I'd like to go a step further and
print the date if a certain thing (or combination of things) occurred
on that day. (i.e. if checkboxes WF and CF were checked...print the
date that they were checked).
My desperate but not functional attempt to correlate the values, line
by line, and place in an array is at the bottom. Thanks for any help!
Shad
open(FH, "C:/perl-scripts/Data/coldseasonworksheet.csv")
or &dienice("couldn't open output file: $!");
seek(FH, 0, SEEK_SET); #goes to beginning of file
my @data = <FH>; #reads file and places in array
close(FH);
my @ETresults = grep(/ET,/, @data);
my $ETnum = @ETresults;
Exiting Troughs this year=$ETnum. <br>
#my @output = (); ###attempt...tried to use "and", "||" so the "||"
would be read first.
#push @output, param('DATE') and param('WF') || param('CF') for
@fields;
------------------------------
Date: Thu, 26 Apr 2007 19:54:26 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Correlating Data from same .csv, line by line
Message-Id: <Xns991EA1DE2A14asu1cornelledu@132.236.56.8>
shadkeene@hotmail.com wrote in news:1177615826.742871.288080
@o40g2000prh.googlegroups.com:
> Here's a complete but minimal example of what I'm doing with a .csv
If so, the word 'complete' has a very different meaning for you.
> file (each line in the .csv file corresponds to a certain date).
> I'm reading the file and printing out simple statistics for the data
> using the grep command.
grep does not print.
> My desperate but not functional attempt to correlate the values, line
> by line, and place in an array is at the bottom.
...
> open(FH, "C:/perl-scripts/Data/coldseasonworksheet.csv")
> or &dienice("couldn't open output file: $!");
There is no dienice subroutine in your code.
Read perldoc perlsub and don't use & to call functions unless you know
what it does.
my $file = 'C:/perl-scripts/Data/coldseasonworksheet.csv';
open my $input, '<', $file
or die "Cannot open '$file': $!";
> seek(FH, 0, SEEK_SET); #goes to beginning of file
You just opened the file. You have not read from the file. You are
already where you want to be.
> my @data = <FH>; #reads file and places in array
> close(FH);
>
> my @ETresults = grep(/ET,/, @data);
I hated ET.
From your code, it looks like you want lines with 'ET,' anywhere in them
but my mindreader says you actually want the lines that start with 'ET,'.
Who knows. You didn't post any sample data to work with.
In any case, there is no need to slurp the file:
my @ETresults;
while ( <$input> ) {
next unless /ET,/; # assuming you meant what you wrote
push @ETresults, $_;
}
> my $ETnum = @ETresults;
OK. But why?
> Exiting Troughs this year=$ETnum. <br>
This is definitely not Perl.
>
> #my @output = (); ###attempt...tried to use "and", "||" so the "||"
> would be read first.
I don't think I can hope to comprehend what you are saying. Besides, the
declaration + initialization is commented out.
In general,
my @output;
is enough. You don't need to initialize it to the empty list.
> #push @output, param('DATE') and param('WF') || param('CF') for
> @fields;
Do you understand that 'and' and '||' are operators with different rules?
Are you just trying to say:
push @output, param('DATE'), param('WF') || param('CF');
That line says: push param('DATE') onto @output. Then, if param('WF') is
true, push that. Else, push param('CF'), whatever it is.
Do you have a good Perl book? (if not, see <http://learn.perl.org/>
Have you read it?
Have you read the posting guidelines? (if not, see
<http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html>)
Sinan
------------------------------
Date: Thu, 26 Apr 2007 14:59:28 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Correlating Data from same .csv, line by line
Message-Id: <463104a1$0$508$815e3792@news.qwest.net>
shadkeene@hotmail.com wrote:
> Hi,
> Here's a complete but minimal example of what I'm doing with a .csv
> file (each line in the .csv file corresponds to a certain date).
No it's an incomplete piece of code that doesn't show anything useful,
and it looks like a hidden CGI question at that..
Read the posting guidelines and try again.
> I'm reading the file and printing out simple statistics for the data
> using the grep command. However, I'd like to go a step further and
> print the date if a certain thing (or combination of things) occurred
> on that day. (i.e. if checkboxes WF and CF were checked...print the
> date that they were checked).
Perl doesn't have checkboxes.
> My desperate but not functional attempt to correlate the values, line
> by line, and place in an array is at the bottom.
>
> open(FH, "C:/perl-scripts/Data/coldseasonworksheet.csv")
> or &dienice("couldn't open output file: $!");
> seek(FH, 0, SEEK_SET); #goes to beginning of file
Why? It's already at the beginning.
> my @data = <FH>; #reads file and places in array
Usually not a good thing to do.
> close(FH);
>
> my @ETresults = grep(/ET,/, @data);
> my $ETnum = @ETresults;
>
> Exiting Troughs this year=$ETnum. <br>
Whatever that means.
>
> #my @output = (); ###attempt...tried to use "and", "||" so the "||"
> would be read first.
> #push @output, param('DATE') and param('WF') || param('CF') for
> @fields;
my @output = @fields if param('DATE') and param('WF') or param('CF');
or...
my @output = @fields if param('DATE') and ( param('WF') or param('CF'));
No idea..
------------------------------
Date: Thu, 26 Apr 2007 11:51:08 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: Determining difference from Vista32 and Vista64
Message-Id: <K96dnQsa_7AUaa3bnZ2dnUVZ_uOmnZ2d@giganews.com>
mpetersrx7 wrote:
> Is ther any way to determine in the running code the type of OS and
> distinguish from 32-bit vs 64-bit Vista or XP. I know the
> Win32::GetOSVersion call but both the 32-bit and 64-bit of Vista
> return the same thing for $major, $minor and $id.
http://support.microsoft.com/kb/827218
From a command line run systeminfo
A lot of information is returned. Look at your
processor type reported.
x86 - 32 bit
x64 - 64 bit
Here is an example from one of my 32 bit dual processor machines.
This is a snip from data returned,
Processor(s): 2 Processor(s) Installed.
[01]: x86 Family 15 Model 4 Stepping 4 GenuineIntel ~2793 Mhz
[02]: x86 Family 15 Model 4 Stepping 4 GenuineIntel ~2793 Mhz
Using your operating system return and your processor type return,
you should be able to determine 32 bit versus 64 bit system.
I do not have a 64 bit box for testing. Your returns should be similar.
You probably will need to make some adjustments for a 64 bit machine.
A 64 bit processor does not guarantee a 64 bit operating system.
However you might find information on a 64 bit box which will
provide precise returns you need for this determination.
If an x86 processor, this cannot be a 64 bit machine.
I found very little related to using Perl to determine 32 bit vs. 64 bit.
#!perl
@Return = `systeminfo`;
print " $Return[2] $Return[3] $Return[15] $Return[16] $Return[17]";
PRINTED RESULTS:
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 2 Build 2600
Processor(s): 2 Processor(s) Installed.
[01]: x86 Family 15 Model 4 Stepping 4 GenuineIntel ~2793 Mhz
[02]: x86 Family 15 Model 4 Stepping 4 GenuineIntel ~2793 Mhz
Purl Gurl
------------------------------
Date: Thu, 26 Apr 2007 12:35:18 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: Determining difference from Vista32 and Vista64
Message-Id: <5ZqdnX03KY1_Y63bnZ2dnUVZ_qGjnZ2d@giganews.com>
Purl Gurl wrote:
> mpetersrx7 wrote:
(snipped)
> http://support.microsoft.com/kb/827218
> x86 - 32 bit
> x64 - 64 bit
I forgot to add, ia64 - 64 bit (Intel)
Should your returns display ia64 for a processor,
this can only be a 64 bit machine.
There are other 64 bit processors which may or may not
run 32 bit systems. I think AMD / Amtel might run either
32 bit or 64 bit. Check me on this.
I do not know if those processors return x64 or other.
Purl Gurl
------------------------------
Date: Thu, 26 Apr 2007 16:22:34 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Determining difference from Vista32 and Vista64
Message-Id: <m2lkgeq41h.fsf@local.wv-www.com>
mpetersrx7@gmail.com writes:
> Is ther any way to determine in the running code the type of OS and
> distinguish from 32-bit vs 64-bit Vista or XP. I know the
> Win32::GetOSVersion call but both the 32-bit and 64-bit of Vista
> return the same thing for $major, $minor and $id.
Seems to me that it might be as useful, or even more so, to know if the
Perl you're running on was compiled with 64-bit support. After all, it
will do you little good to know that you're running on 64-bit Vista, unless
you know whether Perl can take advantage of that.
For that, you can check the Config module:
use Config;
print $Config{use64bitint}, "\n";
print $Config{use64bitall}, "\n";
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 26 Apr 2007 20:30:14 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: FAQ 4.32 How do I strip blank space from the beginning/end of a string?
Message-Id: <4u2233lrud945grkbe47d6svrq1afngeud@4ax.com>
PerlFAQ Server wrote:
>4.32: How do I strip blank space from the beginning/end of a string?
So in what way does a blank space differ from a normal space?
--
Bart.
------------------------------
Date: 26 Apr 2007 19:19:21 GMT
From: xhoster@gmail.com
Subject: Re: Readable/writable database in Perl
Message-Id: <20070426151923.316$mp@newsreader.com>
Eric <ecarlson@vmware.com> wrote:
> Hello,
>
> Currently, our code is utilizing a database that is neither humanly
> readable or writable. My task is to modify the existing code so that
> the database is both.
There is are good reasons that no "real" databases use human readable
and even more so, human writable) data files.
What features of real databases are you willing to surrender to accomplish
this aim? Concurrency? Isolation? Atomicity? Durability? Performance
scalability with increasing database size? All of the above?
> A sample of the code is below - in this
> particular example, to request a mount point. (It does some other
> stuff, such as incrementing/decrementing counts, etc., but that can be
> ignored in relation to this request for assistance.)
If you want us to ignore code, then you should remove before you post it,
rather than just posting it and asking us to ignore it.
> I'm not looking for the solution in the posting (that wouldn't be any
> fun :); what I am looking for is some initial direction on how I might
> go about accomplishing this. There are no shortage of database related
> core and CPAN modules. In particular, I was told to use the 'mySQL'
> approach (if that means anything to anybody).
MySQL does not use human readable or writable data files. Well, unless you
are an extraordinarily gifted human.
> Anyone have an idea on how I might go about this task?
Sure. Step one, specify exactly what the task is, including the answers to
the questions I asked above about you are willing to sacrifice.
Step two, wait for step one.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 26 Apr 2007 14:57:31 -0700
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: Readable/writable database in Perl
Message-Id: <1177624651.565375.303570@r35g2000prh.googlegroups.com>
On Apr 26, 6:08 pm, Eric <ecarl...@vmware.com> wrote:
> Currently, our code is utilizing a database that is neither humanly
> readable or writable. My task is to modify the existing code so that
> the database is both.
> I'm not looking for the solution in the posting (that wouldn't be any
> fun :); what I am looking for is some initial direction on how I might
> go about accomplishing this. There are no shortage of database related
> core and CPAN modules. In particular, I was told to use the 'mySQL'
> approach (if that means anything to anybody).
Well, if you want to use a human readable database you'd do better to
use a database module that uses flat files, like say DBD::CSV or
DBD::AnyData.
------------------------------
Date: 26 Apr 2007 15:07:30 -0700
From: Eric <ecarlson@vmware.com>
Subject: Re: Readable/writable database in Perl
Message-Id: <1177625250.673253.248800@b40g2000prd.googlegroups.com>
Xho,
Thanks for your reply to my posting. My response inline:
> There is are good reasons that no "real" databases use human readable
> and even more so, human writable) data files.
I'm no expert in databases, period. But I did point out to my group
that allowing someone to edit a database might corrupt it. I am only
following instructions on this one.
> What features of real databases are you willing to surrender to accomplish
> this aim? Concurrency? Isolation? Atomicity? Durability? Performance
> scalability with increasing database size? All of the above?
As stated, I am not an expert in databases. So I don't know what we
are willing to give up. Having said that however, the database is will
never grow to great bounds. So I don't think we'd be sacrificing a
whole lot.
> If you want us to ignore code, then you should remove before you post it,
> rather than just posting it and asking us to ignore it.
In the past I have been criticized for posting to this group without
including all of the code. Seems like when I leave something out or
try to simplify things, people seem to focus on that rather than the
question I am asking. So I can't seem to win with that one.
> MySQL does not use human readable or writable data files. Well, unless you
> are an extraordinarily gifted human.
That's good information. Perhaps the person giving me this direction
is unaware of this and we need to go a different route.
> Sure. Step one, specify exactly what the task is, including the answers to
> the questions I asked above about you are willing to sacrifice.
The task is to have a humanly readable/writable database. I don't know
what we'd be willing to sacrifice, but as mentioned already, the
database will be small by database standards.
If we can't have what we want in a database, then I was told that we
could create simple text files instead.
Eric
xhoster@gmail.com wrote:
> Eric <ecarlson@vmware.com> wrote:
> > Hello,
> >
> > Currently, our code is utilizing a database that is neither humanly
> > readable or writable. My task is to modify the existing code so that
> > the database is both.
>
> There is are good reasons that no "real" databases use human readable
> and even more so, human writable) data files.
>
> What features of real databases are you willing to surrender to accomplish
> this aim? Concurrency? Isolation? Atomicity? Durability? Performance
> scalability with increasing database size? All of the above?
>
>
> > A sample of the code is below - in this
> > particular example, to request a mount point. (It does some other
> > stuff, such as incrementing/decrementing counts, etc., but that can be
> > ignored in relation to this request for assistance.)
>
> If you want us to ignore code, then you should remove before you post it,
> rather than just posting it and asking us to ignore it.
>
> > I'm not looking for the solution in the posting (that wouldn't be any
> > fun :); what I am looking for is some initial direction on how I might
> > go about accomplishing this. There are no shortage of database related
> > core and CPAN modules. In particular, I was told to use the 'mySQL'
> > approach (if that means anything to anybody).
>
> MySQL does not use human readable or writable data files. Well, unless you
> are an extraordinarily gifted human.
>
> > Anyone have an idea on how I might go about this task?
>
> Sure. Step one, specify exactly what the task is, including the answers to
> the questions I asked above about you are willing to sacrifice.
>
> Step two, wait for step one.
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Thu, 26 Apr 2007 21:13:00 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: SQL statement in Perl doesn't work
Message-Id: <4630f9bc$0$8517$e4fe514c@dreader29.news.xs4all.nl>
> I do not believe you.
Really. Why?
>
> If you've just put a string in $betaald2006 then it would not be
> undefined. I suspect there are further statements between the two you
> showed us. Either that or $vergelijk is undefined.
Alright. There are indeed some more lines in between:
$betaald2006 = "select betaald2006 from hvw where lidnr = $record and
naam != ' ' and kenmerk2006 is null";
$sth = $dbh->prepare($betaald2006);
$sth->execute or die "SQL Error: $DBI::errstr\n";
@betaald2006 = $sth->fetchrow_array;
$betaald2006 = @betaald2006;
$betaald2006 = $betaald2006[0];
$vergelijk = "N";
if ($betaald2006 eq $vergelijk)
{
And the warning I posted does point to the "if" line. And yes: without
the last AND in $betaald2006 the result is fine. With it, I do get that
warning about 20 times.
------------------------------
Date: Thu, 26 Apr 2007 14:44:25 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: SQL statement in Perl doesn't work
Message-Id: <4631011a$0$502$815e3792@news.qwest.net>
Huub wrote:
[...]
> $betaald2006 = "select betaald2006 from hvw where lidnr = $record and
> naam != ' ' and kenmerk2006 is null";
You don't show the value of $record.
print "SQL=$betaald2006\n";
Actually I'd suggest using a more descriptive variable name..
$betaald2006_sql, or something like that.
> $sth = $dbh->prepare($betaald2006);
my $sth = $dbh->prepare($betaald2006);
> $sth->execute or die "SQL Error: $DBI::errstr\n";
> @betaald2006 = $sth->fetchrow_array;
my @betaald2006 = $sth->fetchrow_array;
Verify the results are what you expect:
use Data::Dumper;
print Dumper( @betaald2006 );
or maybe simply:
print join( "\n", @betaald2006, '');
Using Dumper might make possible data issue more visible.
FYI: That's only the first row, you'll need a loop to iterate
through the other rows, if there are more than one.
Using a more descriptive variable name might be useful too. e.g.
@results, or @betaald2006_results.
> $betaald2006 = @betaald2006;
> $betaald2006 = $betaald2006[0];
That's pointless, just use $betaald2006[0].
> $vergelijk = "N";
> if ($betaald2006 eq $vergelijk)
> {
my $vergelijk = 'N';
print "Does $betaald2006[0] eq $vergelijk?\n";
if ( $betaald2006[0] eq $vergelijk) {
print "Yes\n";
}
Also, if you're only after the first row, use 'limit 1' in your SQL.
>
> And the warning I posted does point to the "if" line. And yes: without
> the last AND in $betaald2006 the result is fine. With it, I do get that
> warning about 20 times.
Using a few print statements should show you/us what's going on.
------------------------------
Date: 26 Apr 2007 20:05:12 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: SQL statement in Perl doesn't work
Message-Id: <slrnf321fq.8fm.glennj@smeagol.ncf.ca>
At 2007-04-26 03:13PM, "Huub" wrote:
> Alright. There are indeed some more lines in between:
>
> $betaald2006 = "select betaald2006 from hvw where lidnr = $record and
> naam != ' ' and kenmerk2006 is null";
> $sth = $dbh->prepare($betaald2006);
> $sth->execute or die "SQL Error: $DBI::errstr\n";
> @betaald2006 = $sth->fetchrow_array;
> $betaald2006 = @betaald2006;
> $betaald2006 = $betaald2006[0];
> $vergelijk = "N";
> if ($betaald2006 eq $vergelijk)
> {
So, clearly, the first column of the first row returned by your query is
null (defined($betaald2006[0]) is false).
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
Date: 26 Apr 2007 11:47:08 -0700
From: paraagv@gmail.com
Subject: Re: STDOUT redirection
Message-Id: <1177613228.068192.116210@r35g2000prh.googlegroups.com>
On Apr 26, 1:29 am, Klaus <klau...@gmail.com> wrote:
> On Apr 25, 10:40 pm, para...@gmail.com wrote:
>
>
>
> > Hi have a perl application in on suse64 bit OS, which internally
> > redirects STDOUT to a $variable
> > using
> > This redirects STDOUT to a variable
>
> > open OUT ,'>',\$variable
> > *STDOUT = *OUT
>
> > Now when run the tool
> > e.g ./app <test>.txt > out.txt
>
> > The application has two parts
> > 1. returns all text data in the <test> input as is to STDOUT
> > 2. returns function call with return values also to STDOUT
>
> > Now what happens is that category 1 collects in out.txt
> > while category 2 collects in the $variable
>
> > my question is why does STDOUT get split into 2 places and how can I
> > avoid it - I want all to goto the variable
>
> I am guessing that your function call has external commands (for
> example system(), `...`, qx(), etc...). If that is the case, then the
> bad news is that the STDOUT of those external commands will not be
> captured by *STDOUT = *OUT
>
> I have never tried it myself, but PerlFaq8: "How can I capture STDERR
> from an external command?" might give some ideas.
>
> --
> Klaus
Thanks for the tip - yes my code does use external perl modules to
return values - different modules return different things and somehow
these are not in order when I try to collect them, the problem is this
does not happen is SUSE32 - is their an OS dependency
------------------------------
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 V11 Issue 384
**************************************