Someone in Timbuktu goes to your web site using their favourite browser
and you want to know their authenticated user name, it that right?
The user's web browser sends this information to your web application
and assuming you are using CGI.pm you can say:
$remote_user_login = remote_user();
In t
Hi list.
I'm a newbie to Perl, (and to this mailing list) :)
There's a task i was given, in which it is necessary to get the
number of the current executing line/command - inside the script itself.
Can someone assist please ?
Thanks in advance,
Amit.
On Wed, Jul 16, 2008 at 3:52 PM, Amit Koren <[EMAIL PROTECTED]>
wrote:
> Hi list.
>
> I'm a newbie to Perl, (and to this mailing list) :)
> There's a task i was given, in which it is necessary to get the
> number of the current executing line/command - inside the script itself.
>
> Can someone as
You could use the __LINE__ directive in your error handler.
-Original Message-
From: Amit Saxena [mailto:[EMAIL PROTECTED]
Sent: 16 July 2008 11:25
To: Amit Koren
Cc: beginners@perl.org
Subject: Re: A newbie question - line number inside the script
On Wed, Jul 16, 2008 at 3:52
This demonstrates it simply enough.
#!/usr/local/ActivePerl-5.8/bin/perl
sub errorhandler {
local ($trapped_line_no) = @_ ;
print "\nThe error handler was invoked from line no is:\t " .
$trapped_line_no . "\n" ;
}
errorhandler( __LINE__ ) ;
-Original Message-
From: Ami
Dermot wrote:
I would say say your just being flash but there is something in the
idea of having a sub {s/\s+//g; for @_;@_}. You do get re-usability.
The data is coming from tab-delimited files and I am trying to parse
the data into a sqlite3 db. In the process I'd like to validate the
data but
Can anyone tell me why the map will not map out the unitialized
variable in this code with 'str'? Thanks a lot,
use strict;
use warnings;
sub total
{
my $firstone = shift;
my $sum = 0;
my $item = 0;
map { defined $_ ? $_ : 'str' } @_ ;
print @_;
}
my $hello;
print "not def
On Jul 15, 11:36 pm, [EMAIL PROTECTED] (Mimi Cafe) wrote:
> remote_user() or user_name() should give you the name of the user if you are
> using CGI.pm.
>
> Mimi
>
> On 15/07/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
>
Masanari Iida wrote:
>
> I am new to perl.
> I run following sample script, and see strace output.
> I have 2 questions.
>
> ===
> #!/usr/bin/perl
>
> use Fcntl qw/:DEFAULT :flock :seek F_GETFL/;
>
> sysopen( LOCK_FILE, "./sample.txt", O_WRONLY | O_CREAT);
>
> $PackedPattern = "ssll
Just use $. To print current line number.
Regards,
Ramkumar
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Weide wrote:
Can anyone tell me why the map will not map out the unitialized
variable in this code with 'str'?
It does.
map { defined $_ ? $_ : 'str' } @_ ;
print @_;
You probably meant to write
print map { defined $_ ? $_ : 'str' } @_ ;
--
Gunnar Hjalmarsson
Email: http://w
On Jul 16, 12:54 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> [EMAIL PROTECTED] wrote:
>
> > On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
>
> >> [EMAIL PROTECTED] wrote:
>
> >>> On Jul 15, 12:32 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
>
> How is this Perl programming being run? It
[EMAIL PROTECTED] wrote:
>
> Below is the code I try in my apache server at windows XP, but it
> return null for both remote_user() or user_name().
>
> #!C:\Perl\bin\perl
> use CGI;
> my $query = new CGI;
> my $userName= $query->user_name();
> my $remoteUser = $query->remote_user();
> print "Con
[EMAIL PROTECTED] wrote:
>
> Can you let me know how configure my IIS web server in order to get
> $ENV{LOGIN_USER} or $ENV{AUTH_USER} ?
That isn't a Perl question and doesn't belong here. You should ask your IIS
system operator, and if you don't have one there is plenty of documentation on
IIS
Weide wrote:
>
> Can anyone tell me why the map will not map out the unitialized
> variable in this code with 'str'? Thanks a lot,
>
>
> use strict;
> use warnings;
>
> sub total
> {
> my $firstone = shift;
> my $sum = 0;
> my $item = 0;
> map { defined $_ ? $_ : 'str' } @_ ;
>
Amit Koren wrote:
>
> I'm a newbie to Perl, (and to this mailing list) :)
> There's a task i was given, in which it is necessary to get the
> number of the current executing line/command - inside the script itself.
>
> Can someone assist please ?
The value of __LINE__ is the source file line
I need to print the COPYRIGHT symbol. How to go about it? Tried
playing with the following:
my $text;
$text = chr(hex(0xa9));
print "CR *$text*\n";
But the script just dies.
Thanks,
Jerry
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http:/
ChrisC wrote:
> I need to print the COPYRIGHT symbol. How to go about it? Tried
> playing with the following:
>
> my $text;
> $text = chr(hex(0xa9));
> print "CR *$text*\n";
>
> But the script just dies.
The hex() function expects a string, but you are giving it 0xa9, which is 129,
and chr(he
elavazhagan perl wrote:
>
> Thanks man...Like babbling ,I have coded for my requirementPlease
> have a glance on the portion of my code .
> Now almost I got the solution...trying to optimize it...
>
> *Note:
> *The value of $ country_code is obtained by the following line *
>
Sivasakthi schreef:
> Is it possible to compare two excel file by using Perl?
Yes, see for example `perldoc -f -s`.
Maybe you are interested in the diff of the two binaries?
Or do you want to check whether the data in the two files are presented
in exactly the same colors and font sizes?
htt
Rob Dixon wrote:
> ChrisC wrote:
>> I need to print the COPYRIGHT symbol. How to go about it? Tried
>> playing with the following:
>>
>> my $text;
>> $text = chr(hex(0xa9));
>> print "CR *$text*\n";
>>
>> But the script just dies.
>
> The hex() function expects a string, but you are giving it 0
The question is about CGI environment variables and perl CGI.pm for that
matter, so he should be able to ask this list for help.
Also, this is not server specific. It's same on Apache and IIS.
The remote_user() or user_name() is only set when the visitor is required by
the web server to authentica
Brad Baxter wrote:
Dermot wrote:
I would say say your just being flash but there is something in the
idea of having a sub {s/\s+//g; for @_;@_}. You do get re-usability.
The data is coming from tab-delimited files and I am trying to parse
the data into a sqlite3 db. In the process I'd like to v
Rob Dixon wrote:
Weide wrote:
Can anyone tell me why the map will not map out the unitialized
variable in this code with 'str'? Thanks a lot,
use strict;
use warnings;
sub total
{
my $firstone = shift;
my $sum = 0;
my $item = 0;
map { defined $_ ? $_ : 'str' } @_ ;
print
Rob Dixon wrote:
ChrisC wrote:
I need to print the COPYRIGHT symbol. How to go about it? Tried
playing with the following:
my $text;
$text = chr(hex(0xa9));
print "CR *$text*\n";
But the script just dies.
The hex() function expects a string, but you are giving it 0xa9, which is 129,
and ch
Mimi Cafe wrote:
>
> The question is about CGI environment variables and perl CGI.pm for that
> matter, so he should be able to ask this list for help.
I don't think anyone suggested that he shouldn't be asking the list for help did
they?
> Also, this is not server specific. It's same on Apache
Weide wrote:
Can anyone tell me why the map will not map out the unitialized
variable in this code with 'str'? Thanks a lot,
use strict;
use warnings;
sub total
{
my $firstone = shift;
my $sum = 0;
my $item = 0;
map { defined $_ ? $_ : 'str' } @_ ;
print @_;
}
my $hello;
Hi Stewart,
Is there *anything* that might convince you to stop top-posting?
Let me put it another way: please stop top-posting.
Thanks.
signature.asc
Description: Digital signature
> This one works. You need quotes around 0xa9.
>
> my $text;
> $text = chr(hex('0xa9'));
> print "CR $text\n";
> Hth,
>
> with warm regards,
> Venkat Saranathan
> Gulf Breeze Software.
>
> On Tue, Jul 15, 2008 at 1:13 PM, ChrisC <[EMAIL PROTECTED]> wrote:
>
>> I need to print the COPYRIGHT symbo
Hello,
How can I view the list of all the character sets supported by Perl?
Could you tell me if I can find it in perldoc or a url at any
website and where it is?
Thanks.
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTE
Thomas Yan wrote:
Hello,
Hello,
How can I view the list of all the character sets supported by Perl?
perl -le'use Encode; print for Encode->encodings(":all")'
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short
Dr.Ruud wrote:
Sivasakthi schreef:
Is it possible to compare two excel file by using Perl?
Yes, see for example `perldoc -f -s`.
Maybe you are interested in the diff of the two binaries?
Or do you want to check whether the data in the two files are presented
in exactly the same co
I still say, converting the excel files in .csv format and then comparing is
not a bad solution.
Regards,
Amit Saxena
On Thu, Jul 17, 2008 at 9:43 AM, Sivasakthi <[EMAIL PROTECTED]> wrote:
> Dr.Ruud wrote:
>
>> Sivasakthi schreef:
>>
>>
>>
>>> Is it possible to compare two excel file by using
Hi All,
My Perl CGI script is working fine when i run the code in the command prompt as
"perl myscript.cgi" . However when i run the same code in the browser(Internet
Explorer), It is not working properly.
I am using "YAML::Syck" module in my CGI Script to parse the YAML file. So i
use this mo
Thank you very much for help.
--
Kind regards,
Ivan Gromov.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hi experts
When I am using STDERR and STDOUT for mixed output, I found a problem.
Output of STDERR and STDOUT can not be mixed.
Here is the snippet.
#
print STDOUT "This is STDOUT\n";
print STDERR "This is STDERR\n";
print STDOUT "This is STDOUT\n";
Prabu Ayyappan <[EMAIL PROTECTED]> asked:
> My Perl CGI script is working fine when i run the code in the
> command prompt as "perl myscript.cgi" . However when i run
> the same code in the browser(Internet Explorer), It is not
> working properly.
Have you tried running the script as the user i
37 matches
Mail list logo