Hi,
Wagner, David --- Senior Programmer Analyst --- CFS
wrote:
> Here is the sample script I was playing with:
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my $MyLine1 = q[%2d %5s %6s];
> my $MyLine2 = q[%2d %5s \n%6s];
The q// operator is equivalent to single quotes, so esc
Hi,
I am new to perl. From where I get the basic perl document
--
Thanks,
MAhesh
mahesh bhasme asked:
> I am new to perl. From where I get the basic perl document
Depends on your distribution, really. If you're on Windows and using the
ActiveState Perl distribution, look for the html folder in your Perl
installation directory.
On Unix, you might want to try perldoc or man
mahesh bhasme wrote:
> Hi,
> I am new to perl. From where I get the basic perl document
>
http://perldoc.perl.org/
--
Just my 0.0002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where
On Monday 26 Oct 2009 10:05:05 Thomas Bätzler wrote:
> mahesh bhasme asked:
> > I am new to perl. From where I get the basic perl document
>
> Depends on your distribution, really. If you're on Windows and using the
> ActiveState Perl distribution, look for the html folder in your Perl
> instal
Shawn H Corey wrote:
John W. Krahn wrote:
$ perl -le'
my $word = "thequickbrown";
my $subsets = 3;
print for $word =~ /(?=(.{$subsets}))/g;
Getting up there but substr is still the fastest.
I had to set the iterations to 300_000, to get rid of warnings.
$ perl5.8.8 3.pl
Rate
hi,
I have this code, mentioned below:
my @word = qw(a b c );
my $length = @word;
my $char1, $char2, $char3;
if ($length == 3){
for ($char1 = 0; $char1<$len;$char1++){
for ($char2 = 0; $char2<$len;$char2++){
for ($char3 = 0; $char3<$len;$char3++){
print "$word[$char1]$word[$char2]$word[$c
Shawn H Corey wrote:
push @list, (unpack( "A${i}A$size", $word ))[1];
Be careful with unpack "A", because it rtrims.
Best use "x" to skip, and "a" to capture.
push @list, unpack "x${_}a$size", $word for 0 .. $max;
Funnily enough, that is somehow&what faster than
push @list, map
Shawn H Corey wrote:
> Perl 6 has a different logo, a cute little butterfly, awww...
> http://perl6.org/
Which (AFAICR) is non-negotiable and in textual mode looks like this:
»ö«
:^)
--
Raf
http://www.catb.org/~esr/faqs/smart-questions.html
--
To unsubscribe, e-mail: beginners-unsub
Michael Alipio wrote:
> Can anyone tell me how the code above works? My original program must
> deal with arbitrary length and generate all the possible combinations
> (even repeating) of a particular set. What could take me gazillions of
> for loops for that, somebody just came up with less than
Dr.Ruud wrote:
> Shawn H Corey wrote:
>
>
>> push @list, (unpack( "A${i}A$size", $word ))[1];
>
> Be careful with unpack "A", because it rtrims.
>
>
> Best use "x" to skip, and "a" to capture.
>
> push @list, unpack "x${_}a$size", $word for 0 .. $max;
>
>
> Funnily enough, that is som
> "M" == "M E8 H " writes:
M> This is an minor topic. I feel the Camel logo to represent Perl to be
M> strange, illogical and slightly ugly. I presume I do not get the humor.
In that sense, it represents Perl precisely.
print "Just another Perl hacker,"; # the original!
--
Randal L. Sc
Thanks for the advice. Forgive me if I sounded like someone who's frustrated,
couldn't do his homework asking somebody else for help.
When I was learning C programming, I read that learning those difficult
algorithms such as bubble sort, quick sort, binary search, is something that
only program
Is there a good way to do printf's with currency symbols?
I've tried this:
printf "Total: \$%10.2f\n", $total;
But it puts the dollar sign way out front (ugly). I want it to look like:
Total:$24.15
Is there a way to do this without getting all messy like this?
printf "Total:%10s\
On 10/26/09 Mon Oct 26, 2009 8:57 AM, "Bryan R Harris"
scribbled:
>
>
> Is there a good way to do printf's with currency symbols?
>
> I've tried this:
>
> printf "Total: \$%10.2f\n", $total;
>
> But it puts the dollar sign way out front (ugly). I want it to look like:
>
> Total:$
On 10/26/09 Mon Oct 26, 2009 8:45 AM, "Michael Alipio"
scribbled:
> Thanks for the advice. Forgive me if I sounded like someone who's frustrated,
> couldn't do his homework asking somebody else for help.
>
> When I was learning C programming, I read that learning those difficult
> algorithms s
Dear friend,I am willing to give you a big surprise. I found
a website: www.ollsu.com last week. They mainly sell phones ,
laptops, tvs ,digital cameras and motorbikes. I ordered a tv . now I
have got the product after 5 days. Its quality is very good.By the
way, they only sell new and original pr
On Mon, Oct 26, 2009 at 12:06 PM, Pat Rice wrote:
> Dear friend,I am willing to give you a big surprise.
>
Friend, I'm willing to give you some good advice!
use warnings;
use strict;
Read http://perldoc.perl.org/
Ian
Michael Alipio wrote:
> I knew I needed a recursive function, I just didn't know how to start.
That is usually the easy part - you start out by solving the problem for a base
case, and then you embellish.
With regard to your problem of generating all combinations of a set of
elements, the base
Is this what you are looking for:
$ perl -e '$total = 24.15 ; printf "Total: \$%.2f\n", $total; '
Regards,
- Robert
On Mon, Oct 26, 2009 at 11:57 AM, Bryan R Harris
wrote:
> Is there a good way to do printf's with currency symbols?
>
> I've tried this:
>
> printf "Total: \$%10.2f\n", $total;
>
I see. You want the output to look something like this:
$ perl -e 'for(my $total = 24.15; $total <3; $total *= 10) {
printf("Total:%10s\n", "\$" . sprintf("%.2f",$total)) ;} '
Total:$24.15
Total: $241.50
Total: $2415.00
Total: $24150.00
Not sure if there is a better way. My guess is
Robert Citek wrote:
> Not sure if there is a better way. My guess is that there is probably
> some module to convert float to currency and then print it as a
> string. But a quick Google didn't turn up anything.
Here' why (extracted from `perldoc perllocale`):
Category LC_MONETARY: Formattin
> Robert Citek wrote:
>> Not sure if there is a better way. My guess is that there is probably
>> some module to convert float to currency and then print it as a
>> string. But a quick Google didn't turn up anything.
>
> Here' why (extracted from `perldoc perllocale`):
>
>Category LC_MONET
2009/10/26 Michael Alipio :
> Then as suggested (see far below), a recursive function will do what I want..
> After some googling I found this:
>
>
> permutate(0,2);
>
> sub permutate($$){
>
> my ($cur,$max) = @_;
>
> if ($cur>=$max){
> print "$result\n";
> return;
> }
>
> for(@word){
A bit of CS philosophy if you may...
On Monday 26 Oct 2009 18:41:23 Jim Gibson wrote:
> On 10/26/09 Mon Oct 26, 2009 8:45 AM, "Michael Alipio"
>
> scribbled:
> > Thanks for the advice. Forgive me if I sounded like someone who's
> > frustrated, couldn't do his homework asking somebody else for
25 matches
Mail list logo