Re: Get Clients Windows Logon ID

2008-07-16 Thread Mimi Cafe
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

A newbie question - line number inside the script

2008-07-16 Thread Amit Koren
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.

Re: A newbie question - line number inside the script

2008-07-16 Thread Amit Saxena
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

RE: A newbie question - line number inside the script

2008-07-16 Thread Stewart Anderson
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

RE: A newbie question - line number inside the script

2008-07-16 Thread Stewart Anderson
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

Re: One step substitution

2008-07-16 Thread Brad Baxter
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

need help on map function

2008-07-16 Thread Weide
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

Re: Get Clients Windows Logon ID

2008-07-16 Thread leolim818
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: >

Re: pack and fcntl question

2008-07-16 Thread Rob Dixon
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

RE: A newbie question - line number inside the script

2008-07-16 Thread V.Ramkumar
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/

Re: need help on map function

2008-07-16 Thread Gunnar Hjalmarsson
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

Re: Get Clients Windows Logon ID

2008-07-16 Thread leolim818
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

Re: Get Clients Windows Logon ID

2008-07-16 Thread Rob Dixon
[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

Re: Get Clients Windows Logon ID

2008-07-16 Thread Rob Dixon
[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

Re: need help on map function

2008-07-16 Thread Rob Dixon
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' } @_ ; >

Re: A newbie question - line number inside the script

2008-07-16 Thread Rob Dixon
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

Printing special characters

2008-07-16 Thread ChrisC
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:/

Re: Printing special characters

2008-07-16 Thread Rob Dixon
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

Re: combo boxes + Perl

2008-07-16 Thread Rob Dixon
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 * >

Re: Compare Excel file

2008-07-16 Thread Dr.Ruud
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

Re: Printing special characters

2008-07-16 Thread Rob Dixon
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

Re: Get Clients Windows Logon ID

2008-07-16 Thread Mimi Cafe
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

Re: One step substitution

2008-07-16 Thread John W. Krahn
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

Re: need help on map function

2008-07-16 Thread John W. Krahn
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

Re: Printing special characters

2008-07-16 Thread John W. Krahn
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

Re: Get Clients Windows Logon ID

2008-07-16 Thread Rob Dixon
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

Re: need help on map function

2008-07-16 Thread Brad Baxter
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;

Re: A newbie question - line number inside the script

2008-07-16 Thread Peter Aronoff
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

Re: Printing special characters

2008-07-16 Thread Venkat Saranathan
> 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

Character Set list

2008-07-16 Thread Thomas Yan
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

Re: Character Set list

2008-07-16 Thread John W. Krahn
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

Re: Compare Excel file

2008-07-16 Thread Sivasakthi
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

Re: Compare Excel file

2008-07-16 Thread Amit Saxena
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

Doubt in Perl CGI

2008-07-16 Thread Prabu Ayyappan
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

Re: Embedding Perl in C: Replacing some subroutine in Perl from C

2008-07-16 Thread Ivan Gromov
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/

Can not mix output of STDERR and STDOUT

2008-07-16 Thread FixReader
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";

RE: Doubt in Perl CGI

2008-07-16 Thread Thomas Bätzler
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