On 05/01/2007 07:09 PM, Vladimir Lemberg wrote:
[...]
system ( "$program -f $program.cfg" );
if ($? == -3) {
[...]
You're facing two problems: the return value for system() needs to be
shifted right by eight bits; and that value is provided in "unsigned"
form, so you have to massage it:
m
Hi Tom,
That was very helpful.
Thanks a lot,
Vladimir
- Original Message -
From: "Tom Phoenix" <[EMAIL PROTECTED]>
To: "Vladimir Lemberg" <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, May 01, 2007 5:36 PM
Subject: Re: Capturing an external program return code
On 5/1/07, Vladimir Lemberg <
On 5/1/07, Vladimir Lemberg <[EMAIL PROTECTED]> wrote:
My script is executing external program, which returns code i.e 0, -1, -2, -3
etc
if ($? == -3) {
This is not working. Nothing is printing to the log file when I'm simulating
-3 code. If I print $?, it shown 65280.
The value in $? i
On 5/1/07, Vladimir Lemberg <[EMAIL PROTECTED]> wrote:
snip
This is not working. Nothing is printing to the log file when I'm simulating -3
code.
If I print $?, it shown 65280.
snip
from perldoc -f system:
if ($? == -1) {
print "failed to execute: $!\n";
}
elsif ($? & 127) {
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote:
Actually, that was just an example to explain my problem. I am facing
this problem when i use Tk. Any subroutine associated with the
-command option of a button widget.
use Tk;
my $mw = MainWindow->new;
my $b = $mw->Button(-text=>'hello',-command=>su
Hi All,
My script is executing external program, which returns code i.e 0, -1, -2, -3
etc
In case of error, I need to create log file according to error code.
For example code -3 means missing input file
use strict;
use warnings;
use Win32;
system ( "$program -f $program.cfg" );
if ($? ==
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote:
my $input = 'loqr';
if ( $input =~ m!lor!i ) {print 'match'}
how will that match? i want them to match. Thats what i want to do.
You can add the 'q' to the pattern. Is this what you want?
if ( $input =~ /loqr/i ) { print 'match' }
Or you can
Somu wrote:
> Actually, that was just an example to explain my problem. I am facing
> this problem when i use Tk. Any subroutine associated with the
> -command option of a button widget.
>
> use Tk;
> my $mw = MainWindow->new;
> my $b = $mw->Button(-text=>'hello',-command=>sub { &welcome })->pack;
Hi, I'm using NetBSD in both, test and production enviroment.
there are many resources for setup perl, and PgPP, DBI, DBD::Pg and Pg
module.
This is a OT, but if you sendme a private mail, maybe can help you.
the http://wiki.netbsd.se have many tutorials for setting a
NAPP(NetBSD+Apache+PostgreSQ
Thats where the problem arises
my $input = 'loqr';
if ( $input =~ m!lor!i ) {print 'match'}
how will that match? i want them to match. Thats what i want to do.
by the way, can i get some url where i can get lots of problems and
solutions on regexp. I'm very weak in it..
--
To unsubscribe, e-ma
Because if define it, it says 'Global variable "$l" needs...' what do
i do? Actually, i am not happy nor sad that the subroutine needed a
declaration before use.. I'm using ActivePerl 5.8.8 on Windows XP
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTE
Actually, that was just an example to explain my problem. I am facing
this problem when i use Tk. Any subroutine associated with the
-command option of a button widget.
use Tk;
my $mw = MainWindow->new;
my $b = $mw->Button(-text=>'hello',-command=>sub { &welcome })->pack;
my $l = $mw->Label(-text
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote:
my $s = <>;
my $t = <>;
conc ( $s , $t );
sub conc {
my $str = $_[0].$_[1];
print $str;
}
Why? It works allright only after add an extra line at the top, that is
sub conc;
its become just like C
Your code works just fine for me (no errors)
On 5/1/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote:
> my $s = <>;
> my $t = <>;
> conc ( $s , $t );
> sub conc {
> my $str = $_[0].$_[1];
> print $str;
> }
>
>
> Why? It works allright only after add an extra line at the top, that is
> sub conc;
>
#!/usr/bin/perl
use strict;
my @Strings = qw(lmn lpt lor mps npr nqt opq rst);
chomp(my $Input = );
my $SortedChars = join "", sort (split //, $Input);
foreach (@Strings)
{
if ($SortedChars =~ /$_/)
{
print "Got a match for $Input with $_\n";
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote:
my $s = <>;
my $t = <>;
conc ( $s , $t );
sub conc {
my $str = $_[0].$_[1];
print $str;
}
Why?
Why not?
It works allright only after add an extra line at the top, that is
sub conc;
its become just like C
Are you asking a question? Per
my $s = <>;
my $t = <>;
conc ( $s , $t );
sub conc {
my $str = $_[0].$_[1];
print $str;
}
Why? It works allright only after add an extra line at the top, that is
sub conc;
its become just like C
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
htt
On 5/1/07, Somu <[EMAIL PROTECTED]> wrote:
Hi, i have a matching problem. I get input from the user as a 3-5
character long string consisting of characters from 'l' to 't', and
the chars are always sorted for example, the user enters: 'lrqo'. It
becomes: 'loqr'. But i have to match the modified
2007/5/2, Somu <[EMAIL PROTECTED]>:
Hi, i have a matching problem. I get input from the user as a 3-5
character long string consisting of characters from 'l' to 't', and
the chars are always sorted for example, the user enters: 'lrqo'. It
becomes: 'loqr'. But i have to match the modified string
Hi, i have a matching problem. I get input from the user as a 3-5
character long string consisting of characters from 'l' to 't', and
the chars are always sorted for example, the user enters: 'lrqo'. It
becomes: 'loqr'. But i have to match the modified string to any of the
following: lmn, lpt, lo
> > Why are you creating these regexes so far from
> where
> > they are used?
> > If you are going to do this at least give them
> > meaningful names.
I dont have a good reason Chas other than I like the
ability to easily change the variable in one spot in
case of future use.
If this is not a goo
On 5/1/07, Maphin Philip <[EMAIL PROTECTED]> wrote:
I am using postgres8.2 in netbsd OS
1.How to install perl here?
Look at your netbsd ports collection documentation on how to install
software on your system using the facility.
2.Can we use perl programs for manipulating data in postg
Hi, I'm a NetBSD user.
Maphin Philip <[EMAIL PROTECTED]> wrote:
> I am using postgres8.2 in netbsd OS
>
>
>
>
>
>
>
> 1.How to install perl here?
>
Maybe it be a OT but it ca do here:
You can ask in private mail ok and can mail all info need for run perl
wit postgresql.
> 2.Can we use
On 5/1/07, oryann9 <[EMAIL PROTECTED]> wrote:
snip
my $regexp = qr/(host:\w+)/is;
my $regexp1 = qr/(onlinejfs.*)/is;
my $regexp2 = qr/(jfs\sversion.*)/is;
snip
Why are you creating these regexes so far from where they are used?
If you are going to do this at least give them meaningful names.
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my @a = qw(abc def ghi);
>
> for my $s (@a) {
> $s =~ /(b)|(e)|(h)/;
> print "1 => [$1] 2 => [$2] 3 => [$3]\n";
> }
>
Thank you for the kind replies. I understand now and
have modified the code to:
use strict;
use warnings
2007/5/1, Maphin Philip <[EMAIL PROTECTED]>:
1.How to install perl here?
2.Can we use perl programs for manipulating data in postgres database
Hello,
1. Google it with keyword "how to install perl on netbsd".
2. Surely you can.Please check the modules on CPAN like DBI.
--
Chinese Practical
I am using postgres8.2 in netbsd OS
1.How to install perl here?
2.Can we use perl programs for manipulating data in postgres database
Thanks
2007/5/1, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
Hi all,
Is there a perl built in function that search a value in sorted array?
Although I found such an algorithm in the cpan (Search::Binary), I wonder if
there is an efficient solution within the core perl.
For large array which was sorted a
Hi all,
Is there a perl built in function that search a value in sorted array?
Although I found such an algorithm in the cpan (Search::Binary), I wonder if
there is an efficient solution within the core perl.
Thanks in advanced,
Yaron Kahanovitch
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
F
29 matches
Mail list logo