From: Jeff Pang <[EMAIL PROTECTED]>
> >Which is the same as
> >
> >sub say {print @_, "\n"}
> >
> >chomp( my $var = );
> >for( $var ) {
> >if( /\D/ ){
> >say "Needs a number!"
> >}
> >elsif( $_ == 1 ) {
> >say "Got 1!"
> >}
> >elsif( $_ == 2 ) {
> >say "
>
>Which is the same as
>
>sub say {print @_, "\n"}
>
>chomp( my $var = );
>for( $var ) {
>if( /\D/ ){
>say "Needs a number!"
>}
>elsif( $_ == 1 ) {
>say "Got 1!"
>}
>elsif( $_ == 2 ) {
>say "Got 2!"
>}
>else {
>say "You said $_"
>}
From: oryann9 <[EMAIL PROTECTED]>
> To share some information in the up-incoming Perl 5.10
> there will be a replacement for the switch clause.
>
> The given-when is the Perl answer to the switch
> (or case) keyword in other programming languages.
> It replaces Switch.pm, which was a pre-Perl 5.10
---
>
> Perl doesn't have the "switch" control statement.
> But you can get it by looking at CPAN:
>
http://search.cpan.org/~rgarcia/Switch-2.13/Switch.pm
>
To share some information in the up-incoming Perl 5.10
there will be a replacement for the switch clause.
The given-when is the Perl answe
On 4/4/07, Igor Sutton Lopes <[EMAIL PROTECTED]> wrote:
snip
unless (fork) {
snip
The fork function has three returns: undef, zero, and non-zero. It
returns 0 to the child and a pid that is non-zero to the parent on
success or undef to the parent on failure. It is important to catch
this
On 2007/04/04, at 14:58, Jeff Pang wrote:
How about this?
if ($ARGV[0] eq 'start') {
print "Starting PostgreSQL:\n";
unless (fork) {
exec "su - $PGUSER -c \"$DAEMON -D \'$PGDATA\' ";
}else {
print "ok\n";
exit;
}
} elsif ($ARGV[0] eq 'stop') {
..
>In bash i have:
>
>#case $1 in
># start)
># $ECHO_N "Starting PostgreSQL: "$ECHO_C
># su - $PGUSER -c "$DAEMON -D '$PGDATA' &"
>>>$PGLOG 2>&1
># echo "ok"
># ;;
>
>In perl, How I to build it ?
>
How about this?
if ($ARGV[0] eq 'start') {
print "Starting PostgreSQL:\
Hello,
I'm changing the script postgresq-init.sh for
postgresql-init.pl. I made all perl scripts for store
the database names. But my doubt is the case.
In bash i have:
#case $1 in
# start)
# $ECHO_N "Starting PostgreSQL: "$ECHO_C
# su - $PGUSER -c "$DAEMON -D '$PGDATA' &"
>>$PGLOG