use strict;
my $var=4536233;
my $new_var=$var/100;
print $new_var;
Shawn
- Original Message -
From: "Stuart Clark" <[EMAIL PROTECTED]>
To: "Perl List" <[EMAIL PROTECTED]>
Sent: Sunday, January 27, 2002 7:56 PM
Subject: decimal point
> Hi,
> I am trying to move the decimal point 2 plac
Hi,
I am trying to move the decimal point 2 places to the the left.
Eg : To make 4536233 into 45362.33
I tried this
$total = "4536233";
$total = sprintf("%0.2f",$total);
print "$total";
But I get this
4536233.00
Can anyone help please
Regards
Stuart Clark
- Original Message -
From: "Shawn" <[EMAIL PROTECTED]>
To: "Connie Chan" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, January 27, 2002 3:00 AM
Subject: Re: What's the different between -> and => ?
> The big arrow is used in place of a ',' (comma). Now, I just read in the late
Hi Dhiraj,
The Script changes the directory while it is runningtry this...
use CWD;
$pw=getcwd; this will get u the present working directory
after u chdir print getcwd...u'll find its in u r desired area...u could
also check if the path exists so as to be sure before chdir...
regs,
s
hello.
sorry , i had unncecessarily opened file handle to write (WH). So here is more correct
algorithm below.
-dhiraj
On Mon, 28 Jan 2002 Dhiraj P Nilange wrote :
>
> Hello,. So here is my recursive
> algorithm for you to compare and see.
> -Dhiraj
>
> #starts here
> $total=0;
> explore(".")
Hello,. So here is my recursive
algorithm for you to compare and see.
-Dhiraj
#starts here
$total=0;
open(WH,"> output.txt");
binmode WH,":raw";
explore(".");
print "over..!\n";
print "total files=$total";
close WH;
sub explore
{
my($dirname)=@_;
my($x);
unless($dirname eq "." || $dirname
For what I understand from those helpers, I think I've made it clear, and
of cause, thank you very much =)
As a summary, I generate this ideas .
-> is using in OO like functions, passing object proterties into a OO
function.
=> is using in a hash, and it is also implies a comma.
just like %foo
You can use Win32::TieRegistry. I've never actually done it, so I can't
give you any tips, but you can perldoc it or look in the help pages that
come with ActiveState if you are using that.
- Original Message -
From: "Max" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January
> The big arrow is used in place of a ',' (comma). Now,
> I just read in the latest Learning Perl that this is
> global (i.e..: you can replace ANY comma with it, but
> I may have misunderstood, have to re-read that again),
>>>
Almost, the following is valid:
my $couple = join " & " => qw(Husba
I'm trying to read information out of the windows registry with part of my perl
program. is there some nice way to do that? in case it matters, i am running Windows
ME.
thank you
max
-
Do You Yahoo!?
Yahoo! Auctions Great stuff seeking new owners! Bid now!
> "Timothy Johnson" <[EMAIL PROTECTED]> said:
>
> Out of curiosity, is there a big performance increase using a recursive
> algorithm like the one described versus an algorithm like below? (This is
> part of something I was working on a while ago, and I wasn't using strict or
> -w at the time,
hey! I quite liked the Castro book... probably not for what it said on the
title (CGI Programming), but as a gentle intro to Perl, it was super... :)
Deen
On Sat, 26 Jan 2002, Matt C. wrote:
> Be careful -- there are a ton of cgi scripts out there that are no good
> (and an entire book by Eli
easy.. just read the filehandle like so...
;
Perl still reads the line like with a normal assignment; it just
disappears 'cause there was nowhere to put it..
you're welcome
deen
On Sun, 27 Jan 2002, Malunas wrote:
> I have a log file in text format. I need to delete the first line s
so matt, can i assume that in perl, to add string to sting, just do this: "string
data...etc..." ($string_to_be_added\n); ? Just put them
next to each other?
bc
Daniel Gardner <[EMAIL PROTECTED]> wrote on 1/27/02 4:18:59 PM:
>
>Sunday, January 27, 2002, 3:03:03 PM, Matt C. wrote:
>
>> Th
thanks for the humor... hehe, i don't know if this is the correct (or most senceable)
way, i just want to lean stuff stuff stuff... anyway,
because you mentioned it, what is an example of the php syntax to do the same? sounds
more doable?
maybe i will try that too, but not naked... hehe
than
Hi,
I have a weird problem with a perl CGI file upload form. When I have no
proxy set I can upload files of any size with no problem but when I set my
proxy I can only upload files under 1 megabyte. This happens with both IE5.5
and Netscape 4.77. In my proxy config I have these lines:
acl QUERY
Sunday, January 27, 2002, 10:00:44 PM, Malunas wrote:
> I have a log file in text format. I need to delete the first line so I could
> put the rest in MySQL database. How do I delete only the first line of this
> text file?
perldoc -q "delete a line in a file"
--
Best Regards,
Daniel
I have a log file in text format. I need to delete the first line so I could
put the rest in MySQL database. How do I delete only the first line of this
text file?
Thanks for your help.
Malunas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
How do I use secure...
-jk-
where do I sign up for that-evil-twin-mailing=list of this one that covers
cgi perl?
-mL
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Jan 27, Pozsar Balazs said:
>Thank for clarification. But one little drak spot:
>
>> Thus, accessing constants via &CONST is slower than, and not the same
>> process as, accessing it via CONST (or +CONST or CONST()).
>
>Is there any difference between CONST and CONST()?
Since CONST is defined
Thank for clarification. But one little drak spot:
> &FOO is NOT a bareword. Moreso, &FOO supercedes the empty prototype.
>
> Thus, accessing constants via &CONST is slower than, and not the same
> process as, accessing it via CONST (or +CONST or CONST()).
Is there any difference between CONST
On Jan 27, Jenda Krynicky said:
>> That kills the constant-ness of them. They have to be seen as
>> barewords for the compile-time replacement of the bareword with its
>> constant value to take effect.
>
>Whoops. I did not know that. I even did not believe you so I
>benchmarked it and you are r
Sunday, January 27, 2002, 3:03:03 PM, Matt C. wrote:
> There's a module called DBD::CSV, which will probably solve your problem. CPAN is
> good at that :). You can tell it what the field separator is and then you'll be
> able to manipulate it however you want with the DBI. I believe you'll need
At 10:06 PM 1/26/02 +0800, Justin Lee wrote:
>:
>I am new to perl. I want to I want to get
>some graph perl example using GD.pm.
> any helps to welcome
>Justin
Try this:
use strict;
use GD;
# create a new image
my $im = new GD::Image(100,100);
# allocate some colors
my $white = $im->colorAll
From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]>
> On Jan 27, Jenda Krynicky said:
>
> >> use constant TEMPLATE => '/usr/lib/templates/foo.html';
> >> use File::Copy;
> >> copy TEMPLATE => $destination;
> >
> >I usualy write constants with the &. So that when I make a
On Jan 27, Jenda Krynicky said:
>> use constant TEMPLATE => '/usr/lib/templates/foo.html';
>> use File::Copy;
>> copy TEMPLATE => $destination;
>
>I usualy write constants with the &. So that when I make a typo I
>get the more understandeable
That kills the constant-ness of them. T
> "Jenda" == Jenda Krynicky <[EMAIL PROTECTED]> writes:
>> So, in general, I actively discourage the use of fatarrow as a funny
>> comma, unless that use is to explicitly quote the left argument.
Jenda> One has to know the implications.
Exactly. So it's one of those trickier things, that w
From: [EMAIL PROTECTED] (Randal L. Schwartz)
> > "Jenda" == Jenda Krynicky <[EMAIL PROTECTED]> writes:
>
> Jenda> I think the nicest example is
>
> Jenda>use File::Copy;
> Jenda>copy $source => $destination;
> [edited slightly]
>
> The big problem with using the big arrow t
> "Jenda" == Jenda Krynicky <[EMAIL PROTECTED]> writes:
Jenda> I think the nicest example is
Jenda> use File::Copy;
Jenda> copy $source => $destination;
[edited slightly]
The big problem with using the big arrow there is when you have
constants:
use constant TEMPLATE => '/usr/lib/tem
From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
> > One is called the 'big' arrow (=>) and one is called
> > the 'little' arrow (->).
>
> Like Little Horn and Big Horn from the old westerns? ;-)
>
> > The big arrow is used in place of a ',' (comma). Now,
> > I just read in the
> "Jonathan" == Jonathan e paton <[EMAIL PROTECTED]> writes:
Jonathan> A better example is the closure:
Jonathan> my $sub = sub { print "Hello " . shift . "\n" };
Jonathan> $sub->("World");
That's not a closure. It's merely an anonymous subroutine.
A closure is a subroutine (named or not)
There's a module called DBD::CSV, which will probably solve your problem. CPAN is
good at that :). You can tell it what the field separator is and then you'll be
able to manipulate it however you want with the DBI. I believe you'll need to
install the bundle, found here:
http://search.cpan.org/
i have a mdb db, i use with asp
i want to switch to php
i want to use perl to convert the csv produced from this mdb to make a many many lined
sql statement for my php db, in order to get the
data to it
so in perl, how do i turn each line of csv data into sql statements by adding "insert
int
> One is called the 'big' arrow (=>) and one is called
> the 'little' arrow (->).
Like Little Horn and Big Horn from the old westerns? ;-)
> The big arrow is used in place of a ',' (comma). Now,
> I just read in the latest Learning Perl that this is
> global (i.e..: you can replace ANY comma w
-> is how you reference an object's methods/properties
=> is pretty syntax to separate the key => value pairs in a hash
On Sun, 27 Jan 2002, Connie Chan wrote:
> Would anybody tell me what's the different between -> and => ?
> Thanks a lot =)
>
>
--
Deen Hameedd, Accidental Programme
One is called the 'big' arrow (=>) and one is called the 'little' arrow (->).
The big arrow is used in place of a ',' (comma). Now, I just read in the latest
Learning Perl that
this is global (i.e..: you can replace ANY comma with it, but I may have
misunderstood, have to
re-read that again),
36 matches
Mail list logo