> "BF" == Brian Fraser writes:
BF> On Sat, Jun 11, 2011 at 5:15 PM, Mike McClain wrote:
>>
>> # set up an alias for the fastest prime generator
>> *primes = \&sieve_eratosthenese_lucky;
>>
>>
BF> Just use that, but wrap it in a BEGIN block.
that isn't going to help. we do
On 2011-06-11 17:20, JP wrote:
How can I load a library depending on the platform I run on?
A use statement is always processed at compile time, no matter if there
are BEGIN blocks or if statements around it, or where it is in the source.
Check out "use if" (see perldoc if), or do the strin
On 11-06-11 11:20 AM, JP wrote:
How can I load a library depending on the platform I run on?
Try:
BEGIN {
use English qw( -no_match_vars );
if ( $OSNAME eq "linux" ) {
use Device::SerialPort qw( :PARAM :STAT 0.07 );
}
elsif ( $OSNAME eq "MSWin32" ) {
use Win32::SerialPort qw(
I have a problem with my serial device on Windows, whereas it works fine on
Linux.
It works fine on Linux:
use Device::SerialPort qw( :PARAM :STAT 0.07 );
$PortObj = new Device::SerialPort ($PortName, $quiet, $lockfile) || die "Can't
open $PortName: $!\n$file_exists"; }
I get an err
Hi all,
I need to load a different library, depending on the platform I am running on.
When running on Linux, I need "Device::SerialPort";
while running on Windows I need "Win32::SerialPort".
This is what I came up with:
if ( $OS eq "linux" ) { use Device::SerialPort qw( :PARAM :STAT 0.07 ); }
On Sat, Jun 11, 2011 at 5:15 PM, Mike McClain wrote:
>
> # set up an alias for the fastest prime generator
> *primes = \&sieve_eratosthenese_lucky;
>
>
Just use that, but wrap it in a BEGIN block.
OK, it's probably not called an alias but I don't know the proper term.
I've been exploring prime number generation algorithms and after putting
the various routines in primes.pm I thought it would be neat to name the
fastest simply primes as so:
# set up an alias for the fastest prime generator
Dr. Ruud wrote:
> Because of RaiseError, that 'or die' is unreachable code
That's good to know. I wasn't aware of that. I'm reading up on it
now. Thanks!
Gurpreet Singh wrote:
> Just use a boolean "read_Primary_Key" (default false) and then true after
> reading the first line.
Since $count is nowhere used again, why increment it each time just for the
sake of reading primary key. Just use a boolean "read_Primary_Key" (default
false) and then true after reading the first line.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail:
On 11-06-11 11:14 AM, eventual wrote:
Hi,
I am using windows7.
Using Perl, how do I search for files in my computer, eg to search in c:\ and
all its sub-directories.
I only know how to use glob to search from a particular location.
Thanks
You can use File::Find, see `perldoc File::Find`. It i
On 2011-06-11 04:25, sono...@fannullone.us wrote:
# Connect to the server to create the db, if it doesn't exist already.
my $dbh_db = DBI->connect("DBI:mysql:database=;$host",
$username, $password,
{'RaiseError' => 1});
The "RaiseError"
On Jun 11, 2011, at 2:21 AM, Shlomi Fish wrote:
> Very well, I'll comment on your code.
Thanks, Shlomi. Much appreciated.
>>my $username = 'root';
>>my $password = 'root';
>>my $host = "127.0.0.1:8889";
>>my $db = "test_dbb";
> I hope you are not connecting to
Hi,
I am using windows7.
Using Perl, how do I search for files in my computer, eg to search in c:\ and
all its sub-directories.
I only know how to use glob to search from a particular location.
Thanks
On Sat, 11 Jun 2011 08:25:15 +0200, marcos rebelo wrote:
> I need to discover all the packages (not files, the symbolic tables)
> that are child of my package, something like:
>
> my @child = map { $_->isa('My::Class') } ->ALL_PACKAGES<-
>
> How do I create the ->ALL_PACKAGES<- list?
Class::Ins
At 08:28 -0700 10/06/2011, Gurpreet Singh wrote:
Correct me if i am wrong -
$read = 0 unless /\s[A-Z]{3}:/;
This might pick up wrong values also - since one of the DBLINKS data
(the first record) might also get picked up - it should match this
regex.
Run my script with the data and see. $r
Hi Marc,
On Saturday 11 June 2011 05:25:18 sono...@fannullone.us wrote:
> O.K. I've finished my code to create a MySQL db and/or table, and I'd
> appreciate hearing your comments. It works well, but it needs to be
> cleaned up before going live. I've left some testing code in. Go ahead
>
I found an half solution, since it doesn't get me the ->ALL_PACKAGES<-
mro::get_isarev($classname)
How do I get the ->ALL_PACKAGES<-?
Thanks for all your help
Marcos Rebelo
On Sat, Jun 11, 2011 at 08:25, marcos rebelo wrote:
>
> I need to discover all the packages (not files, the symbolic tab
17 matches
Mail list logo