Hi,
I am using windowsXP and I have my perl installed in c:\perl
I wish to write my own module and so I wrote a simple module and saved it in
c:\perl\site\lib\mymod.pm but when I ran myscript below, nothing was printed
out and the error msg was Global symbol @a requires explicit package name at
- Original Message -
From: John W. Krahn jwkr...@shaw.ca
To: Perl Beginners beginners@perl.org
Sent: Thursday, February 26, 2009 10:54 PM
Subject: Re: regarding regular expression
Irfan Sayed wrote:
Hi All,
Hello,
I have a string like this
Hi,
Looking at the script below, why does the while function loop 6 times instead
of 3 times when @data have only 3 elements and
I thought the output should be:-
1 $_ = aaa1
2 $_ = bbb2
3 $_ = ccc3
Thanks
#
#!/usr/bin/perl
use strict;
use warnings;
- Original Message -
From: Chas. Owens chas.ow...@gmail.com
To: itshardtogetone itshardtoget...@hotmail.com
Cc: beginners@perl.org
If you absolutely must avoid outputting data until after the loops are
finished, you should probably write your output to a file and then
display the file
Hi,
Looking at the script below, can someone explain why the final output is Final
= 1 instead of Final = 5.
I thought at the end of the while loop, $a_ctr is 5, this value is then read by
the sub module data() and this value of 5 is then passed on to sub publish
before its being printed out.
Original Message -
From: David Shere dsh...@steelerubber.com
To: itshardtogetone itshardtoget...@hotmail.com
Cc: beginners@perl.org
Sent: Tuesday, February 10, 2009 3:29 AM
Subject: Re: question on 2 sub modules on the same scope
What is an a_ctr, anyway? :)
Thanks everyone
Hi,
Looking at the script below, I wish to print out line 1 first, which is after
the while loop, then followed by First loop, and then Second loop,
henceforth I have the script below. What I did was to hold on the printing of
First loop and Second loop by pushing them into @printer which was
Can someone introduce me a free Perl editor that also can easily produce html
codes.
Thanks
From: Blazer evanstroh...@yahoo.co.uk
To: beginners@perl.org
Sent: Sunday, February 08, 2009 7:05 AM
Subject: How hard is it to learn this langauge?
I just kept reading that Perl was a very easy
language to learn. Is this true or is it propaganda???
Perl is quite easy to learn. Example if
Hi,
How do I print the % sign when using printf.
I did the following which produced the following error illegal conversion in
printf %) at line 185
printf (Total $total_number_of_bets\(%4.2f\%\)
times.\n,$percentage_total_number_of_bets);
Thanks
Hi,
How do I copy the first 10 elements of @a into @b?
The method that I use is long :-
my @a = 1..20;
my @b = ();
my $ctr = 0;
foreach (@a){
if ($ctr 10){
push @b,$_;
}
$ctr ++;
}
Thanks.
Hi,
I have the script below but IE did not maximize. What must I do to maximize IE.
Thanks
#!/usr/bin/perl
use strict;
use warnings;
use Win32::IEAutomation;
# Creating new instance of Internet Explorer
my $ie = Win32::IEAutomation-new( visible = 1, maximize = 1);
# Site navigation
Hi,
I wish to open a file datafile.txt which is stored in the same location as
the perl script, so how do I write it down?
open (FILE,'', ) || die no such
files $!\n;
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional
Hi,
My website is hosted in 110mb.com and they do not have this module installed
Algorithm::Numerical::Shuffle qw /shuffle/;
So what can I do to use that module.
Thanks
Hi,
I have a simple script to read the inputs of a simple form.
I just wanted to see what is read by this script when the form is submitted.
Upon submission of the form, the script print the following :
name=simon+garfunkalemail=asdfdsasdf.asdf.comage=12favorite_color=pink
Usually a script to
Hi,
Looking at the script below which when uploaded into my homepage in
wave.prohosting.com, and when I ran the script, I got an error which says
Error 500 Internal Server Error .
After several debugging, I realised that if I comment-out the shuffle-module
(#use Algorithm::Numerical::Shuffle
Hi,
Whats the perl command to run a script or program.
Thanks
Hi,
I move around quite alot. So how do I install perl into my thumbdrive. I did a
yahoo search and I found one but too technical ==
http://www.perlmonks.org/?node=Portable+perl%3A+usb+thumbdrive
Thanks
Hi,
What is the command to recall the drive location of my script?
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
From: Randal L. Schwartz [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Sunday, October 05, 2008 2:49 PM
Subject: Re: how to fill in forms of yahoo sign up site
itshardtogetone == itshardtogetone
[EMAIL PROTECTED] writes:
itshardtogetone I want to have a program to autofill those yahoo
Hi,
I want to have a program to autofill those yahoo signup forms such as this ==
https://edit.yahoo.com/registration?.v=.intl=sgnew=1.src=ym.partner=.p=promo=.last=.done=http://sg.yahoo.com/
The names, and other details are saved in a text file. How do I do this?
Thanks
Hi,
I use internet explorer 7.0 to browse the website.
I upload a simple script, helloworld.cgi, to my website but when I ran the
script by typing the url, www.myurl.com/cgi-bin/helloworld.cgi, instead of
executing the script, I was prompted to download the script.
What must I do.
Thanks
Hi,
How do I randomly produce a date between 1st Jan 1960 to 31th December 1985. It
must be able to show the day month year.
I only know how to produce a random number between 1960 to 1985 using rand like
this :
my $year = int (rand 26) + 1960;
Thanks
Hi,
How do I round off a decimal to the next nearest whole digit ,
example
0.123 = 1,
1.23 = 2,
4.7312 = 5, etc etc.
Right now I can only do the above by extracting the first digit using splice
, then add one.
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Hi,
I tried to install the module plot.pm, by following the undermentioned method
http://www.base64.co.uk/installing-perl-modules/ but I failed. What have I
missed?
I am using windowsXP. I am using Perl-5-10. I installed perl in c:\perl\.
To install the module plot.pm, using the methods below,
From: yitzle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Sent: Tuesday, May 27, 2008 7:55 AM
Subject: Re: how to plot graphs
You can use a module off CPAN. A quick search gave me this:
http://search.cpan.org/~smorton/Chart-Plot-0.11/Plot.pm
Hi,
Thanks.
I have activeperl
- Original Message -
From: yitzle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Sent: Tuesday, May 27, 2008 7:55 AM
Subject: Re: how to plot graphs
You can use a module off CPAN. A quick search gave me this:
http://search.cpan.org/~smorton/Chart-Plot-0.11/Plot.pm
From: Rob Dixon [EMAIL PROTECTED]
To: beginners@perl.org
Cc: [EMAIL PROTECTED]
Sent: Wednesday, May 28, 2008 2:51 AM
Subject: Re: how to plot graphs
snip off
There is no need to restrict yourself to an Excel row to hold graph x-axis
values. More often a spreadsheet column will be used to
Hi,
In the script below, I have an array @datas with its elements consisting of
numbers like this :-
my @datas = (
'1 2 3', '1 2 4', '1 2 7', '1 2 8', '1 2 9', '1 6 7',
'1 7 12', '2 6 7', '4 5 10', '4 5 15'
);
Out of the above list, I wish to generate a seperate array so that among
From: Richard Lee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Sent: Sunday, May 04, 2008 3:17 AM
Subject: Re: how to simplify this script
I don't have the solution yet but shouldn't the answer be
1 6 7
and
4 5 10 only ?
it's printing out 1 2 3 as well which is wrong?
Thanks
Hi Gunnar and Members
I am very thrilled with your solutions. Is 'LOOP' as in LOOP: foreach
( @datas ) { =
a function or a command etc. I could not find this function in
http://perldoc.perl.org/index-functions.html#L
Thanks
- Original Message -
From: Gunnar
Hi,
What must I do to my perl script so that my friends can run my perl script from
their computer, using windows as the operating system, without having to
install perl into their system.
Technically, this conversion is it called compiling?
Thanks
Hi,
How do I simplify the regex below so that it matches only the number 1,
henceforth it should return false if I match $string with $match.
use strict;
use warnings;
my $string = 10 11 12 13 40;
my $match = 1;
if ($string =~/^$match | $match | $match$/g){
print match;
}else{
print
Hi Members,
Can someone explain why the foreach loop did not iterate 10 times.
Thanks
#
use strict;
use warnings;
my @data = (1..10);
foreach (@data){
splice @data,0,1;
print printing [EMAIL PROTECTED] = @data\n;
}
# results ###
printing @data = 2 3 4 5 6 7
Thanks Gary,
But some of us may wish to know why $str =~ m/tokena(.*)tokenb/ms; did not
get all the things between tokena and tokenb into $str?
This is how my mind think:-
(1) The /s switch means to be able to match across newlines.
(2) .* means to match zero or more of anything.
Henceforth
my $count = () = $str =~ /a/g;
Thanks Chas. Owens,
I need some explanation on the above on how the above regex count the number
of 'a' in a string.
With my limited understanding, this is what I thought:-
$count = () ; #To me it means $count is assigned with a undefined value
which is then
Hi,
How do I construct a regex to count the number of 'a' within a scalar variable
such as the undermentioned.
One method I can think of is to split the scalar string into a list and then do
the counting but I just feel that this in not necessary.
Thanks
{
my $string = 'hello there are many a
Hi,
How about this :-
foreach (@Treasures){
if ($_=~ /:1:2:3:/){
print do your stuffs here\n:
}
}
- Original Message -
From: Lou Hernsen [EMAIL PROTECTED]
To: beginners@perl.org; [EMAIL PROTECTED]
Sent: Thursday, April 10, 2008 1:07 AM
Subject: Testing an array for a
Thanks Jenda, Chas.Owens and fellow members.
What do you mean by globalise?
Jenda
Looking at the script below, in diagram 1, $capital will not be incremented
unless I write it as in diagram 2.
Just because I do not want $capital to be reset on each foreach loop, I then
have to declare
Hi Members,
1)The script below produce the following warnings:- variable
$betting_system will not stay shared at roulette.pl line 61.
What is the problem and how do I rectify this problem.
2)How do I shorten/improve this script.
Thanks
# start of script #
Hi,
Assuming my script use a strict pragma.
If I have a lexical variable declared inside a sub routine and I wish to
globalize this lexical variable, what are the various options to globalise this
variable?
Thanks
###
use strict;
use warnings;
testing();
sub testing {
my
Hi,
I am doing some homework from the book Learning Perl chapter 4 excercise 1,
Looking at the script below, I wonder why line 6 (print Enter some numbers on
separate line: ;) is not printed immediately after the previous print.
Thanks
use strict;
use warnings;
my @fred = qw/1 3 5 7 9/;
my
Hi,
The script below is suppose to erase off, from a file, all blank lines
including newlines, I wrote the regex is as follows : s/^\s*$//;
however after running the script, a last newline remains.
Can someone explain why the regexp can erase off all newlines in the file
except the last
Hi,
With regards to the script below, inside the foreach loop, can someone explain
to me why the expression $_=~ s/\nfred\n/nancy/;
did not change the default variable $_ from fred (enclosed by \n) to nancy.
Thanks
# start of script ###
use strict;
open (MYDATA,
Thanks everyone for the help!
I get an error on 'chop' when I use the following. Why is this so?
Thanks
use strict;
use warnings;
my @eightdecks = 1..20;
my $last = chop ($eightdecks[0] + $eightdecks[2]);
if ($last =~ /[0-5]/){
print yes match.\n;
}else{print not match\n};
- Original
Hi,
How do I write the expression, if the variable match between 0 to 10? Below is
the wrong expression I wrote which is suppose to be if $eightdecks match 0 to
10. So i want the answer to be yes.
Thanks
my $eightdecks = 6;
if($eightdecks =~ /[0-10]/){
print Yes match\n;
}else{print no};
ok, I found my error, it should be as follows if I want to match number 6:-
my $_ = 62; if( $_ =~ /^6$/){
- Original Message -
From: [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Wednesday, April 02, 2008 5:07 PM
Subject: simple reg ex matching
Hi,
The value of $_ is 62. In the
Hi,
The value of $_ is 62. In the script below, I just wonder why the default
variable match the number 6. What I wanted to say is that if the default
variable $_ holding the value of 62, if match the number 6, then print Yes
match. So what is the right way to right.
Thanks
use strict;
use
Hi,
How do I extract the last digit of a number? example I only want the digit 9
from the number 19.
my $number = 19;
- Original Message -
From: Gunnar Hjalmarsson [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Thursday, March 27, 2008 8:27 AM
Subject: Re: question on lexical declaration and submodule
...
but I dont think this is a good idea as the sub-module will then have a
mixture of both
Hi,
I am doing some studies on sub modules and Lexical variables (my).
With regards to diagram 1 below, what can I do so that the lexical $counter can
count up to 4.
Of course, one way of doing this is to change the lexical $counter into a
global variable as seen in diagram 2 but I dont think
Hi ,
Looking at the reg expression ( $playercard1 =~ /10|J|Q|K/ ),
it will match 0, 1, and '10' , J, Q, K
What must I do so that it will match only '10' , 'J', 'Q', and 'K'
Thanks
- Original Message -
From: Rodrick Brown [EMAIL PROTECTED]
#!/usr/bin/perl -w
use strict;
use
Hi,
With regards to the script below, can somebody explain to me why $testcounter
after counting 1,2,3, remains at 3 all the time. I thought it would have been
reset to zero by the outer while loop.
Thanks
#!c:\perl\bin\perl
use strict;
my $anything = 5;
my $counter =0;
while ($anything
Thanks Rob and members,
What do you mean by but since you have declared a subroutine that
references the variable
Thank You.
Ed
- Original Message -
From: Rob Dixon [EMAIL PROTECTED]
To: beginners@perl.org
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 23, 2008 9:06 AM
Subject: Re:
Hi, Members
The script below produce an error at the printf function at line 342 which says
Illegal division by zero at \perl\baccarat.pl line 342..
Can someone tell me whats wrong.
Thanks
partial script===
my $total = $banker_counter + $player_counter;
open
Hi,
I want to read the installed perl manual on use strict, so how do I search
the perl manual for use strict
Thanks
Hi,
How do I shorten this code:-
if $playercard1 = 10 or $playercard1 = J or $playercard1 = Q or
$playercard1 = K;
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Thank You very much everyone here.
Thanks for providing me leads to study.
- Original Message -
John W. Krahn [EMAIL PROTECTED],
Rodrick Brown wrote:
Tom Phoenix
Gunnar Hjalmarsson
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks,
Ok, I have successfully installed Algorithm::Numerical::Shuffle using the
activestate PPM.
I am using windowsXP.
I have installed Perl in c:\perl
So how do I use the above installed shuffle module to shuffle the list
below :-
@cards = (1,2,3,4,5,6,7,8,9,10);
Thanks
- Original
ok, this is what I have tried but I got and internal system error msg like
this An internal system error has occurred which prevents us from
responding to your request.
- start of script--
use Algorithm::Numerical::Shuffle;
Shuffle @baccarat =
Thanks,
Ok, I have successfully installed Algorithm::Numerical::Shuffle using the
activestate PPM.
I am using windowsXP.
I have installed Perl in c:\perl
So how do I use the above installed shuffle module to shuffle the list
below :-
@cards = (1,2,3,4,5,6,7,8,9,10);
Thanks
- Original
Hi,
I wish to shuffle 8 decks of cards, so how do I shorten this code :-
use Algorithm::Numerical::Shuffle qw /shuffle/;
@eightdecks = shuffle
(1..10,J,Q,K,1..10,J,Q,K,1..10,J,Q,K);#how do I repeat 1 to K
32 times
print @eightdecks ;
Hi,
I wish to run my perl/cgi scripts from Windows Internet explorer in offline
mode, therefore I need to activate some kind of servers, can someone here
recommend me some free servers.
Thanks
Jim.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Thanks everyone for the help. Originally I intent to use sambar but it has
recently discontinue. I wanted to use apache but it seems quite difficult to
get it up, please correct me if I am wrong.
As I am getting the server just to run my perl script in MS Internet
explorer, for learning
Hi,
Why do I get error for this :-
print hello world;
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi,
I wish to use the module shuffle from cpan.
I have downloaded perl to c:\perl
so where do I install the module to?
thanks
66 matches
Mail list logo