On Thu, May 30, 2019 at 10:21 AM John SJ Anderson wrote:
>
>
> Do you know if there is a list of environmental variables anywhere?
>
>
> I think maybe this is what you’re looking for?
> https://perldoc.pl/perlrun#ENVIRONMENT
>
Thanks John. perlrun - I probably would not
On Thu, May 30, 2019 at 10:14 AM Andrew Solomon wrote:
>
> Assuming you're on a Linux box the command 'env' should tell you that. Is
> that what you're looking for?
No. I'm looking for a list of Perl specific environmental variables.
Like the one you offered
>
> Do you know if there is a list of environmental variables anywhere?
I think maybe this is what you’re looking for?
https://perldoc.pl/perlrun#ENVIRONMENT <https://perldoc.pl/perlrun#ENVIRONMENT>
ld do the trick:
>>
>> export PERL5LIB="$PWD:$PERL5LIB"
>>
> Thanks, that fixed the Perl path problem.
>
> Do you know if there is a list of environmental variables anywhere?
>
> Jeff
>
--
Andrew Solomon
Director
P: +44 7931 946 062
E: and...@geekuni.com
On Thu, May 30, 2019 at 9:19 AM Andrew Solomon wrote:
> In that case I think this should do the trick:
>
> export PERL5LIB="$PWD:$PERL5LIB"
>
Thanks, that fixed the Perl path problem.
Do you know if there is a list of environmental variables anywhere?
Jeff
In that case I think this should do the trick:
export PERL5LIB="$PWD:$PERL5LIB"
On Thu, May 30, 2019 at 2:14 PM Jeffrey Walton wrote:
> On Thu, May 30, 2019 at 9:06 AM Hao Wu wrote:
> >
> > https://perldoc.perl.org/Env.html
>
> Thanks Hao.
>
> Is there
On Thu, May 30, 2019 at 9:06 AM Hao Wu wrote:
>
> https://perldoc.perl.org/Env.html
Thanks Hao.
Is there a list of the environmental variables used by Perl?
I'm not trying to write Perl code. I am trying to setup the
environment because Perl can't find some files in a scrat
/linux.die.net/man/1/perl (and others). It is
> not clear to me which section of the manual covers environmental
> variables used by Perl.
>
> I found this online, but it does not appear that Perl actually honors
> PATH: https://docs.perl6.org/programs/03-environment-variables . (I
>
t
> know Perl so it is a struggle. I am happy to refer to the manual, and
> it is located at https://linux.die.net/man/1/perl (and others). It is
> not clear to me which section of the manual covers environmental
> variables used by Perl.
>
> I found this online, but it does not appe
Hi Everyone,
I need to fix a self test for a C library written in Perl. I don't
know Perl so it is a struggle. I am happy to refer to the manual, and
it is located at https://linux.die.net/man/1/perl (and others). It is
not clear to me which section of the manual covers environmental
vari
On Tue, Jan 10, 2017 at 09:04:00AM +0100, Luca Ferrari wrote:
> Hi all,
> I guess it was in Modern Perl that I saw this deprecated idiom to
> simulate state <http://perldoc.perl.org/functions/state.html>
> variables:
>
> sub foo{
>my $initialized_once = 1 if 0;
&
Hi all,
I guess it was in Modern Perl that I saw this deprecated idiom to
simulate state <http://perldoc.perl.org/functions/state.html>
variables:
sub foo{
my $initialized_once = 1 if 0;
...
}
Now, why is that working and initializing the variable the first time?
I mean, each time su
On Wed, Mar 19, 2014 at 1:49 PM, Thomas H. George wrote:
> $_ = " H K53deloresg Bills Hank99
> Pellinor";
> if (/\s*(\w+)\s*(\w+)\*(\w+)\s*(\w+)\s*(\w+)\s*(\w+)/i) {
>
This pattern is missing the "\s" after the second (\w+). The "\*" matches a
literal as
On Wed, 19 Mar 2014 14:49:32 -0400
"Thomas H. George" wrote:
> if (/\s*(\w+)\s*(\w+)\*(\w+)\s*(\w+)\s*(\w+)\s*(\w+)/i) {
> $dud1 = $1;
> $dud2 = $2;
> $w_player = $3;
> $n_player = $4;
> $e_player = $5;
> $s_player = $6;
> }
How about:
( $dud1, $dud2, $w_play
On Wed, Mar 19, 2014 at 1:49 PM, Thomas H. George wrote:
> Here is the code that is not working
>
The code you sent was missing an 's' in the RE. It also has no print stmt -
trying:
#!/usr/bin/perl
use diagnostics;
use strict;
#...
my $dud1 = "dud1";
my $dud2 = "dud2";
my $w_player = "?";
my $
program runs to completion with this block of code included.
After the program ends diagnostics complains that the program tried to
print $dud2 which had not been initiated. The other match variables
print with their assigned initiated values.
My system is Debian Wheezy with perl 5.14.2-21 i
On Tue, Sep 24, 2013 at 8:23 AM, Harry Putnam wrote:
> The way in use in script below works... quotations around "@_", so the
> content is passed rather than the element count. And the ways that
> are commented out also work.
>
Yeah, that's a bit of a fragile idiom - inside dbl quotes, arrays a
See below, please.
On 09/24/2013 09:23 AM, Harry Putnam wrote:
Somehow I had it my mind that perl would recognize an incoming
variable to a sub routine like:
sub test($var)
As $_ if there was only one element to @_,
But I see from testing that, no, not true.
These three methods below a
Somehow I had it my mind that perl would recognize an incoming
variable to a sub routine like:
sub test($var)
As $_ if there was only one element to @_,
But I see from testing that, no, not true.
These three methods below all
work. Perhaps there are others.
if ( -f "@_" )
(my $fname) =
> >>>
> >>> The subroutine does not see the lexical $counter variable because it was
> >>> declared after its scope.
> >>
> >> The subroutine is never called before $counter is declared, so it is
> >> always available to the subroutine. There shou
ever called before $counter is declared, so it is
>> always available to the subroutine. There should be an error only for
>> instances when the subroutine is called before $counter is declared.
>>
>>> For more information, see:
>>>
>>> * http://www.plov
On 27/06/2013 15:44, Shawn H Corey wrote:
On Thu, 27 Jun 2013 15:07:58 +0200
"Dr.Ruud" wrote:
On 27/06/2013 12:58, lee wrote:
Ok, so perl has a totally broken design with variables :(
No, your understanding is broken. Can you come back after you fixed
it?
That is rude. The r
On Thu, Jun 27, 2013 at 11:22 AM, Rob Dixon wrote:
> Something like this may help you
>
> use strict;
> use warnings;
>
> do_something({ title => 'TEST', value => 42 });
>
> sub do_something {
> my ($params) = @_;
> print $params->{title}, "\n";
> do_something_el
r called before $counter is declared, so it is
always available to the subroutine. There should be an error only for
instances when the subroutine is called before $counter is declared.
For more information, see:
* http://www.plover.com/FAQs/Namespaces.html
Ok, so perl has a totally broken
$counter = 0;
sub test {
# This can see the above declaration. It wouldn't be able to
# see the one below.
print $counter, "\n";
}
#my $counter = 0;
while($counter < 5) {
test();
$counter++;
}
__END__
The whole point of lexical variables
> That is rude. The reason this list exists is to help people, not to
> tell them to go away. No wonder Perl is not a popular language.
Agreed. Dr. Ruud, that was uncalled for. You're not obligated to
respond to posters, and if that's the best response you have, not
responding would be a better ch
On Thu, 27 Jun 2013 15:07:58 +0200
"Dr.Ruud" wrote:
> On 27/06/2013 12:58, lee wrote:
>
> > Ok, so perl has a totally broken design with variables :(
>
> No, your understanding is broken. Can you come back after you fixed
> it?
>
That is rude. The reason
tine does not see the lexical $counter variable because it was
>> declared after its scope.
>
> The subroutine is never called before $counter is declared, so it is
> always available to the subroutine. There should be an error only for
> instances when the subroutine is called befor
On 27/06/2013 12:58, lee wrote:
Ok, so perl has a totally broken design with variables :(
No, your understanding is broken. Can you come back after you fixed it?
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http
On Thu, 27 Jun 2013 12:58:38 +0200
lee wrote:
> Ok, so perl has a totally broken design with variables :( What's the
> solution to this problem?
The usual technique is to declare the configuration variables at the
top, followed by the file-scoped variables. It is convention that the
declared, so it is
always available to the subroutine. There should be an error only for
instances when the subroutine is called before $counter is declared.
> For more information, see:
>
> * http://www.plover.com/FAQs/Namespaces.html
Ok, so perl has a totally broken design with variables :( What
Hi
On 26 Jun 2013 09:49, "lee" wrote:
>
> Hi,
>
> the following example doesn't compile:
>
>
> use strict;
> use warnings;
>
>
> sub test {
> print $counter . "\n";
The variable $counter is not known here
> }
>
>
> my $counter = 0;
> while($counter < 5) {
> test();
> $counter++;
> }
>
Hi Lee,
On Wed, 26 Jun 2013 10:18:44 +0200
lee wrote:
> Hi,
>
> the following example doesn't compile:
>
>
> use strict;
> use warnings;
>
>
> sub test {
> print $counter . "\n";
> }
>
>
> my $counter = 0;
> while($counter < 5) {
> test();
> $counter++;
> }
>
>
> It says "Gl
Scope?
On Wednesday, June 26, 2013, lee wrote:
> Hi,
>
> the following example doesn't compile:
>
>
> use strict;
> use warnings;
>
>
> sub test {
> print $counter . "\n";
> }
>
>
> my $counter = 0;
> while($counter < 5) {
> test();
> $counter++;
> }
>
>
> It says "Global symbol "$cou
Hi,
the following example doesn't compile:
use strict;
use warnings;
sub test {
print $counter . "\n";
}
my $counter = 0;
while($counter < 5) {
test();
$counter++;
}
It says "Global symbol "$counter" requires explicit package name ...".
When I put the subroutine after the 'whil
> Dear All,
>
> I am having an XLSX file in server and my OS in Win7. The first open
> statement is working fine in which we have give the actual file name.
>
> 2nd open function is not working where we have given the file name as
> variable.
>
> Please help in resolving this error.
>
>
> use
On May 7, 2013, at 1:48 AM, Ganesh Babu N wrote:
> I tried your method but it showing the same error.
Which method? I made two suggestions. It is always helpful to post the exact
program that you tried and the exact error message you are getting. As I
explained, I do not have a Windows system
I tried your method but it showing the same error.
Ganesh
On Mon, May 6, 2013 at 8:58 PM, Jim Gibson wrote:
>
> On May 6, 2013, at 6:42 AM, Ganesh Babu N wrote:
>
> >
> > Dear All,
> >
> > I am having an XLSX file in server and my OS in Win7. The first open
> statement is working fine in which
I make promish when i learn to perl, i'll help the more people has possible.
I hope i don't forget!!
On Mon, May 6, 2013 at 4:28 PM, Jim Gibson wrote:
>
> On May 6, 2013, at 6:42 AM, Ganesh Babu N wrote:
>
> >
> > Dear All,
> >
> > I am having an XLSX file in server and my OS in Win
On May 6, 2013, at 6:42 AM, Ganesh Babu N wrote:
>
> Dear All,
>
> I am having an XLSX file in server and my OS in Win7. The first open
> statement is working fine in which we have give the actual file name.
>
> 2nd open function is not working where we have given the file name as
> variable
Dear All,
I am having an XLSX file in server and my OS in Win7. The first open
statement is working fine in which we have give the actual file name.
2nd open function is not working where we have given the file name as
variable.
Please help in resolving this error.
use Win32::OLE;
use Win32::O
On 10/09/2012 08:20 AM, Mark Haney wrote:
So, this is obviously a problem bigger than just this one routine. But
bugger me if I know where to go from here.
I don't even know what to say now. I have it working. I'm not entirely
sure /why/ it works, but it does. Just for fun, I changed th
On 10/05/2012 11:38 AM, Shlomi Fish wrote:
Hi Mark,
please include a self-contained, minimalised, reproducing example, so we
can see what you are doing wrong. Moreover, sometimes minimalising the
code to something more self-contained helps you find the problem.
Regards,
Shlomi Fis
Hi Mark,
On Fri, 05 Oct 2012 11:25:01 -0400
Mark Haney wrote:
> On 10/04/2012 03:23 PM, Shlomi Fish wrote:
> > On Thu, 4 Oct 2012 18:11:50 +
> > Mark Haney wrote:
> >
> > This may be a culprit - it seems to be a reference to a scalar that
> > is itself an array reference. Usually just doing
On 10/04/2012 02:11 PM, Mark Haney wrote:
I've got a Template Toolkit template that is driving me insane. I've hit the
TT list, but it seems more and more like the problem may be more perl related
than a templating issue. I've attached the offending files so now let me show
what the problem
On Thu, 4 Oct 2012 18:11:50 +
Mark Haney wrote:
> I've got a Template Toolkit template that is driving me insane. I've
> hit the TT list, but it seems more and more like the problem may be
> more perl related than a templating issue. I've attached the
> offending files so now let me show wh
I've got a Template Toolkit template that is driving me insane. I've hit the
TT list, but it seems more and more like the problem may be more perl related
than a templating issue. I've attached the offending files so now let me show
what the problem is.
I have two SQL statements that pull fac
On May 23, 2012, at 5:35 PM, John W. Krahn wrote:
> Your question is not about quoting variables, which is bad, but about quoting
> hash keys.
On May 23, 2012, at 5:25 PM, Shawn H Corey wrote:
> Yes, you can leave the quotes off if the key contains only alphanumerics.
> Otherwise
sono...@fannullone.us wrote:
Subject: To quote variables or not
Your question is not about quoting variables, which is bad, but about
quoting hash keys. See:
perldoc -q quoting
A script that I'm refactoring has global variables in two different
styles, e.g.:
$main::global-&
On 12-05-23 08:13 PM, sono...@fannullone.us wrote:
A script that I'm refactoring has global variables in two different
styles, e.g.:
$main::global->{form}->{'mailprog'}
$main::global->{form}->{mailprog}
The quote marks don't seem to make a
A script that I'm refactoring has global variables in two different
styles, e.g.:
$main::global->{form}->{'mailprog'}
$main::global->{form}->{mailprog}
The quote marks don't seem to make a difference, so what would be the
advantage of using
Hi Pradeep,
use List::Util qw( sum );
use constant {
SUFFICIENT_SUCCESS => 244
}
...
my $success = sum( map { /success$/ ? $results_href->{$_} : () } keys
%$results_href );
...
return $success == SUFFICIENT_SUCCESS;
-- iD
2012/1/22 Pradeep Patra
> Hi,
> I have a hash reference as follows:
Hi,
I have a hash reference as follows:
$VAR1 = {
A.processor0.error => 0
A.processor0.success => 77
A.processor0.total=> 77
A.processor1.error=> 0
A.processor1.success => 57
A.processor1.total=> 57
A.processor2.error=>
;> SELECT * FROM `events` WHERE `date` BETWEEN ? AND ?
> >> /);
> >> $sth->execute($begin_time, $end_time);
> >
> > I can certainly do it this way, however, my ultimate goal is to
> > have these variables passed via a web form and since I
;s another (and in my opinion, usually better) way:
using prepared sql statement:
my $sth = $dbh->prepare(q/
SELECT * FROM `events` WHERE `date` BETWEEN ? AND ?
/);
$sth->execute($begin_time, $end_time);
I can certainly do it this way, however, my ultimate goal is
ent:
> my $sth = $dbh->prepare(q/
> SELECT * FROM `events` WHERE `date` BETWEEN ? AND ?
> /);
> $sth->execute($begin_time, $end_time);
>
>
> I can certainly do it this way, however, my ultimate goal is to have these
> variables passed via a web form and since I'
Hi Mark,
On Fri, 30 Dec 2011 12:39:04 -0500
Mark Haney wrote:
> On 12/30/2011 12:30 PM, Igor Dovgiy wrote:
> > Hi Mark,
> >
> > If your variables are strictly internal and by no means might be ever
> > tainted (read: user input), what you're doing is mostly o
On 12/30/2011 12:30 PM, Igor Dovgiy wrote:
Hi Mark,
If your variables are strictly internal and by no means might be ever
tainted (read: user input), what you're doing is mostly ok.
But you need to quote the dates passed within query itself, like this:
my $sql = qq/SELECT * FROM `e
On Fri, 30 Dec 2011 12:08:50 -0500
Mark Haney wrote:
> I'm not sure if this is the right list for this, so bear with me. If it
> isn't I'll be glad to post it on the correct one.
>
> I've got a problem with passing variables to a SQL server inside a CGI
Hi Mark,
If your variables are strictly internal and by no means might be ever
tainted (read: user input), what you're doing is mostly ok.
But you need to quote the dates passed within query itself, like this:
my $sql = qq/SELECT * FROM `events` WHERE `date` BETWEEN '$begin_time'
I'm not sure if this is the right list for this, so bear with me. If it
isn't I'll be glad to post it on the correct one.
I've got a problem with passing variables to a SQL server inside a CGI
script. My code is like this:
my $begin_time = "2011-11-16 11:00:00&quo
On 11/22/11 Tue Nov 22, 2011 10:25 AM, "Noah"
scribbled:
> HI list,
>
> Is there an easy way to get variables defined from another file?
> specifically I have a series of scalar, array, and hash variables in an
> external file. How can I use those variables defin
On 11-11-22 01:25 PM, Noah wrote:
Is there an easy way to get variables defined from another file?
specifically I have a series of scalar, array, and hash variables in an
external file. How can I use those variables defined and used in the
main perl program?
See:
perldoc -f use
perldoc -f
HI list,
Is there an easy way to get variables defined from another file?
specifically I have a series of scalar, array, and hash variables in an
external file. How can I use those variables defined and used in the
main perl program?
Cheers,
Noah
--
To unsubscribe, e-mail: beginners
On Wed, Aug 17, 2011 at 9:58 PM, Randal L. Schwartz
wrote:
> Golfers do NOT understand the DAMAGE they are doing to Perl's
> perception outside the Perl community, and I wish they'd damn well
> stop.
In my experience, people outside of the Perl community perceive /any/
Perl as obfuscated anyway
> Golfers do NOT understand the DAMAGE they are doing to Perl's
> perception outside the Perl community,
What is golf?
Hi Marc,
Perl "golf" is a game where one reduce the number of characters {key
"strokes"} used in a perl program, just like how golf players seek to hit
balls into series
On Aug 17, 2011, at 6:58 PM, Randal L. Schwartz wrote:
> Golfers do NOT understand the DAMAGE they are doing to Perl's
> perception outside the Perl community,
What is golf?
Marc
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@
> ""John" == "John W Krahn" writes:
>> That's deprecated though, if not already gone. (Looks gone in Perl
>> 5.14.) It was a readily-admitted misfeature.
John> Unless you're playing golf. :-)
I'd argue that Golf itself is a misfeature of Perl. More like a bug.
Golfers do NOT understan
On Thu, 11 Aug 2011 23:30:32 -0700, John W. Krahn wrote:
> Peter Scott wrote:
>> On Thu, 11 Aug 2011 16:17:51 -0700, siegfried wrote:
>>> Is there a way to do it with less typing? How can I do it without
>>> creating a temporary variable "@p"? Thanks, siegfried
>>>
>>> find /xyz -exec perl -e 'fore
Randal L. Schwartz wrote:
"John" == "John W Krahn" writes:
John> split() uses @_ by default so you could just say:
That's deprecated though, if not already gone. (Looks gone in Perl
5.14.) It was a readily-admitted misfeature.
Unless you're playing golf. :-)
John
--
Any intelligent f
> "John" == "John W Krahn" writes:
John> split() uses @_ by default so you could just say:
That's deprecated though, if not already gone. (Looks gone in Perl
5.14.) It was a readily-admitted misfeature.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
http:/
On 12/08/2011 18:52, Rob Dixon wrote:
> On 12/08/2011 00:17, siegfr...@heintze.com wrote:
>> This works! Is there a way to do it with less typing? How can I do it
>> without creating a temporary variable "@p"?
>> Thanks,
>> siegfried
>>
>> find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; r
On 12/08/2011 00:17, siegfr...@heintze.com wrote:
This works! Is there a way to do it with less typing? How can I do it
without creating a temporary variable "@p"?
Thanks,
siegfried
find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
"./$p[$#p].txt" } '
find /xyz -exec perl -e
On Thu, Aug 11, 2011 at 7:17 PM, wrote:
> find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
> "./$p[$#p].txt" } '
If I'm reading this right then it looks like you're trying to
recursively move all files in /xyz into the current directory.
Probably don't need Perl for that.
fi
Peter Scott wrote:
On Thu, 11 Aug 2011 16:17:51 -0700, siegfried wrote:
This works!
Really? I get "find: missing argument to `-exec'"
I think your command also renames directories. You want that?
Is there a way to do it with less typing? How can I do it
without creating a temporary variab
On Thu, 11 Aug 2011 16:17:51 -0700, siegfried wrote:
> This works!
Really? I get "find: missing argument to `-exec'"
I think your command also renames directories. You want that?
> Is there a way to do it with less typing? How can I do it
> without creating a temporary variable "@p"? Thanks,
Shawn H Corey wrote:
On 11/08/11 07:17 PM, siegfr...@heintze.com wrote:
This works! Is there a way to do it with less typing? How can I do it
without creating a temporary variable "@p"?
Thanks,
siegfried
find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
"./$p[$#p].txt" } '
On Thu, 11 Aug 2011 16:17:51 -0700, wrote:
> This works! Is there a way to do it with less typing? How can I do it
> without creating a temporary variable "@p"?
rename($_, sprintf("./%s.txt", (split '/')[-1]));
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands,
On 8/11/11 Thu Aug 11, 2011 4:17 PM, "siegfr...@heintze.com"
scribbled:
> This works! Is there a way to do it with less typing? How can I do it
> without creating a temporary variable "@p"?
> Thanks,
> siegfried
>
> find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
> "./$p[$
On 11/08/11 07:17 PM, siegfr...@heintze.com wrote:
This works! Is there a way to do it with less typing? How can I do it
without creating a temporary variable "@p"?
Thanks,
siegfried
find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
"./$p[$#p].txt" } '
find /xyz -exec pe
This works! Is there a way to do it with less typing? How can I do it
without creating a temporary variable "@p"?
Thanks,
siegfried
find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_,
"./$p[$#p].txt" } '
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
Could someone please remove lel...@claimspages.com from the mailing list
so I won't get any more of these annoying messages?
Original Message
Subject: Re: Re: environment variables in perl
Date: Mon, 18 Jul 2011 09:31:05 -0400
From: RightFax E-mail Gateway
To: sha
On 11-07-18 09:24 AM, Christian Walde wrote:
On Mon, 18 Jul 2011 13:44:39 +0200, Shawn H Corey
wrote:
In Windows, there is only one environment. That means if a child
process changes it, its parent can access the change.
In Linux, each process has its own environment. The child process
inheri
On Mon, 18 Jul 2011 13:44:39 +0200, Shawn H Corey wrote:
In Windows, there is only one environment. That means if a child
process changes it, its parent can access the change.
In Linux, each process has its own environment. The child process
inherits its parent's at the time of the fork and
On 11-07-18 07:29 AM, Irfan Sayed wrote:
if i do in perl like this :
print "Environment is : $ENV{'build'}\n";
then it does not pint anything
can someone please suggest ??
In Windows, there is only one environment. That means if a child
process changes it, its parent can access the change.
hi,
i am executing one shell script within perl script. now what i
need is , i need to make available all the variables set by that shell
script to perl script
for example
following is the shell script
build="abc"
export build
echo $build
now the value of $build i need to acce
hi,
i am executing one shell script within perl script. now what i need is , i need
to make available all the variables set by that shell script to perl script
for example
following is the shell script
build="abc"
export build
echo $build
now the value of $build i need to acce
On Mon, Mar 28, 2011 at 11:10, Katya Gorodinsky
wrote:
> Maybe this way:
>
> @bet1 = (0,0,0,0);
> @bet2 = (0,0,0,1);
> @bet3 = (0,0,1,0);
>
> $random_bet_position = int(rand(3) + 1);
>
> $name = 'bet' . $random_bet_position;
> @selected_bet = @{$name};
Symbolic references are incredibly danger
On Mon, Mar 28, 2011 at 12:10 PM, Katya Gorodinsky <
katya.gorodin...@ecitele.com> wrote:
> $random_bet_position = int(rand(3) + 1);
>
> $name = 'bet' . $random_bet_position;
> @selected_bet = @{$name};
>
> No no no.
Gosh no.
Don't do that.
http://perl.plover.com/varvarname.html
Brian.
2011/3/28 jj mahoney :
>
> Hi, How do I name this variable correctly, @{bet$random_bet_position);
> With regards to the script below, @selected_bet is suppose to select either
> @bet1, @bet2 or @bet3 depending on the chosen number held by
> $random_bet_position, so how do I do this? Thanks
>
> @b
h 28, 2011 4:28 PM
To: beginners@perl.org
Subject: problem with naming of variables
Hi, How do I name this variable correctly, @{bet$random_bet_position);
With regards to the script below, @selected_bet is suppose to select either
@bet1, @bet2 or @bet3 depending on the chosen numb
2011/3/28 jj mahoney
>
> Hi, How do I name this variable correctly, @{bet$random_bet_position);
> With regards to the script below, @selected_bet is suppose to select either
> @bet1, @bet2 or @bet3 depending on the chosen number held by
> $random_bet_position, so how do I do this? Thanks
>
> @bet
Hi, How do I name this variable correctly, @{bet$random_bet_position);
With regards to the script below, @selected_bet is suppose to select either
@bet1, @bet2 or @bet3 depending on the chosen number held by
$random_bet_position, so how do I do this? Thanks
@bet1 = (0,0,0,0);
@bet2 = (0,0,0,1)
On Mon, Dec 13, 2010 at 1:05 AM, John W. Krahn wrote:
> shawn wilson wrote:
>>
>> i'm trying to exclude undefined variables for that are to be put into
>> a sql database date field, but none of this is working:
>>
>> sub correctdate { # make valid
shawn wilson wrote:
i'm trying to exclude undefined variables for that are to be put into
a sql database date field, but none of this is working:
sub correctdate { # make valid sql DATE field
my $date = $_[ 0 ];
my ($month, $day, $year) = split / /, $date if defined(
; return $corrected;
>
Also, if I may, a word about your code: You keep testing some variables for
definedness, but don't do anything when they are undefined, so you end up
piling on checks. Wouldn't it be simpler to return early? For instance, if
$date isn't defined, nothing else
On Sun, Dec 12, 2010 at 8:11 PM, shawn wilson wrote:
> i'm trying to exclude undefined variables for that are to be put into
> a sql database date field, but none of this is working:
errr, sorry, my error with the current code is:
Global symbol "$corrected" requires exp
i'm trying to exclude undefined variables for that are to be put into
a sql database date field, but none of this is working:
sub correctdate { # make valid sql DATE field
my $date = $_[ 0 ];
my ($month, $day, $year) = split / /, $date if defined( $date );
$day =~ s/,/
Try:
eval "\$test =~ y/$x/$y/;";
Perfect.
Thanks,
John
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 10-11-29 11:51 PM, John wrote:
I tried using that, but $test wasn't changed here:
$test = "This is a test.";
$x = "is";
$y = "si";
eval $test =~ y/$x/$y/;
print "$test\n";
Try:
eval "\$test =~ y/$x/$y/;";
--
Just my 0.0002 million dollars worth,
Shawn
P
1 - 100 of 1251 matches
Mail list logo