RE: z/OS unicode problem.
Hi, May be this is could be useful; Unicode characters have two bytes for each character. Each character has 0x00 following to the each character. You need to remove the 0x00 after each character and then do the Regular Expression matching. my $temp = chr(0x00); $line =~ s/$temp//g; this remove the Unicode characters from the line. Regds Suresh -Original Message- From: Rajarshi Das [mailto:[EMAIL PROTECTED] Sent: Thursday, March 03, 2005 5:33 AM To: beginners@perl.org Subject: z/OS unicode problem. Hi, I had a question regarding utf-ebcdic issues on z/OS. I tried this on a perl-5.8.6. If I use a unicode character within a character class and try matching the same using a regular expression, I get a failure. e.g. if I write this ; use charnames:full; $a = \N{LATIN SMALL LETTER A WITH GRAVE}; $b = \N{LATIN CAPITAL LETTER A WITH GRAVE}; $a =~ m/[$b]/i; This fails whereas, $b =~ m/[$a]/i; passes. Does anyone have thoughts on why this might be happening ? Alternately, could someone let know as to who could help ? Thanks in advance, Rajarshi. _ Click, Upload, Print. http://www.kodakexpress.co.in?soe=4956 Deliver in India. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: [Printer Installation]: Problem withy X-64 and IA-64
Hi, Could anyone help me in this? I need it a bit urgent. Thanks and Regards Suresh -Original Message- From: Suresh Pasupula (WT01 - EMBEDDED PRODUCT ENGINEERING SOLUTIONS) Sent: Saturday, October 23, 2004 12:25 PM To: [EMAIL PROTECTED] Subject: [Printer Installation]: Problem withy X-64 and IA-64 Hi, I am able to install a printer by running the following command at the command prompt: rundll32 printui.dll,PrintUIEntry /if /b PrinterModelName /f InfPath /r LPT1: /m PrinterModelName /z I am able to run the above command successfully and install the printer using system command in PERL in X86 machines. Now the problem is it is failing to run the command in AMD 64 machines. Same is seen in IA 64 machines when I copied the PERL binaries into IA 64 machines and tried to run the command. So can anyone of you tell me why this problem is and also let me know the remedy. NOTE: I am using ActivePerl-5.8.0.806-MSWin32-x86.msi installer for installing PERL. The same can be used to install in AMD 64 machines as it is 32 bit compatible. Thanks and Regards Suresh Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
[Printer Installation]: Problem withy X-64 and IA-64
Hi, I am able to install a printer by running the following command at the command prompt: rundll32 printui.dll,PrintUIEntry /if /b PrinterModelName /f InfPath /r LPT1: /m PrinterModelName /z I am able to run the above command successfully and install the printer using system command in PERL in X86 machines. Now the problem is it is failing to run the command in AMD 64 machines. Same is seen in IA 64 machines when I copied the PERL binaries into IA 64 machines and tried to run the command. So can anyone of you tell me why this problem is and also let me know the remedy. NOTE: I am using ActivePerl-5.8.0.806-MSWin32-x86.msi installer for installing PERL. The same can be used to install in AMD 64 machines as it is 32 bit compatible. Thanks and Regards Suresh Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
[Perl Downloads for Windows OS: IA64 and AMD64]
Hi, I am in need of PERL for Windows OS for IA64 and AMD64 bit Machines. Can anyone of you let me know where I can get the links for downloading? Thanks and Regards SURESH PASUPULA Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: [Perl Downloads for Windows OS: IA64 and AMD64]
Hi Chris, Thanks for the prompt response. Yeah I have tried that before I sent the mail to the perl group. I am not able install perl using the package available in Active State. The package that is available there is only for X86 Platform. It does not allow you to install in 64 bit Platforms. I tried copying the same X86 Perl Binaries into IA64 machine. I am not able to see the results as expected in IA64 when I am trying to install the printers using rundll32 command I am unable. The command is fine but the program hangs in IA64 and is working fine in X86 Platform. That is the reason I was searching for the installable Perl for 64 bit platform. -- Thanks and Regards Suresh Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Split the line with | character
Hi, Try using in the following way, $DELIM_PIPE = '|'; @data = split /[$DELIM_COMMA]/,$line; or @data = split /['|']/,$line; Regards Suresh -Original Message- From: Wil [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 07, 2004 2:39 AM To: [EMAIL PROTECTED] Subject: Split the line with | character Dear Folks, I'm trying to split a line that contains a pipe | and I cann't find a way how to do it. If i put a back slash \, it doesn't work either. Can somebody help me how to do it? My code is : while ($line = FILE) { chomp $line; @data = split (\|,$line); .. } Thanks Wil -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: Backticks alternative?
You can use in the following way: $exec = ls -l; $src = system($exec); -Original Message- From: gohaku [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 06, 2004 9:59 AM To: Perl Beginners Subject: Backticks alternative? Hi everyone, After using backticks to retrieve executable output, I would like to know if there is a backtick alternative. For example, to get a File Listing on a Unix-based system, I will do the usual: $exec = ls -l; $src = `$exec`; Unfortunately, I find the ` to be unreadable and confusing because it looks like a quote. Thanks in advance. -gohaku -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
[Doubt] : Validate Printer Port
Hi, How to validate the given printer port? I want to know if it is a TCP/IP or local port. If it is a TCP/IP Port then I wan to validate if it exists (Raw port 9100). Also I want to validate the format of IP-Address. Could anyone let me know how can I achieve this? Thanks and Regards Suresh
[Doubt]: Retrieve System Info like Which OS and type
Hi, I need to retrieve the following system Info from the current system. 1. Operating System 2. Localization 3. 32 Bit or 64 Bit I searched but could get only this info $^O. This gives only MSWINNT but nut much info. Could anyone let me know where can I such info? Thanks and Regards Suresh
RE: [Socket Programming]: Need info for Client / Server scenario
Hi James, Can you suggest me what this POE is? Where can I get info regarding this? Thanks and regards Suresh -Original Message- From: James Edward Gray II [mailto:[EMAIL PROTECTED] Sent: Monday, May 31, 2004 9:19 PM To: Suresh Pasupula (WT01 - EMBEDDED PRODUCT ENGINEERING SOLUTIONS) Cc: [EMAIL PROTECTED] Subject: Re: [Socket Programming]: Need info for Client / Server scenario On May 30, 2004, at 11:06 PM, [EMAIL PROTECTED] wrote: Hi, Howdy. I need some good links for understanding socket programming (Client / Server programming). Not a link specifically, but I feel I would be letting you down if I didn't mention Network Programming with Perl. That is an excellent book that covers exactly what you're after and much more. I strongly recommend it. I have written some scripts for multiple clients and a server (Forking Server). But I am facing some problems - the server data has to be shared among all the child processes - does this happen when we fork - what should I do for this to happen. There are basically three major approaches to these kinds of servers: Forking, Threaded, and Non-Blocking IO. As others have mentioned, Forking is probably not the way to go in this instance. You want one of the other two. A Threaded server is the easier of the two to write. Unfortunately, it's still plenty involved so I do suggest referencing to book I mentioned above. Another option you might want to look into is POE, which will probably greatly simplify this kind of thing. It have a learning curve you would need to pass too, but can be useful in many applications. Unfortunately, this option isn't covered by the Networking book, so you'll have to use the POE documentation, if you go this way. Good luck. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
[Socket Programming]: Need info for Client / Server scenario
Hi, I need some good links for understanding socket programming (Client / Server programming). I have written some scripts for multiple clients and a server (Forking Server). But I am facing some problems - the server data has to be shared among all the child processes - does this happen when we fork - what should I do for this to happen. Requirement is: Normal clients keep polling the server for some info. Server will get some info from a master client till then the server responds back with null info to the Normal clients. The server data that my master client is updating should get reflected in all the child processes (of forked server) - this is not happening. What should I do to achieve this? Also I want my server to respond back immediately to all the clients getting connected. This is not happening. Kindly help me in solving the problem. Following are the code snippets for clients and server: Server Code Snippet: my $MySocket = new IO::Socket::INET( LocalHost = $hostname, LocalPort = 7890, Proto = 'tcp', Listen= SOMAXCONN, Reuse = 1); $MySocket or die Error: no socket :$!; STDOUT-autoflush(1); print Server Program Started\n; print Waiting ...\n; while ($client_sock = $MySocket-accept()) { # execute a fork, if this is # the parent, its work is done, # go straight to continue next if $kid = fork; die fork: $!\n unless defined $kid; # child now... # close the server - not needed close $MySocket; STDOUT-autoflush(1); print \nACCEPTED: New Client\n; while (defined($buf = $client_sock)) { chomp ($buf); print Recievied: $buf\n; if ($buf =~ / NORMAL_CLIENT/i) { ... # return NULL if $val is NULL # else return proper value $buf = $val; } elsif ($buf =~ /MASTER_CLIENT/) { ... # read the info # update the variable $val if not NULL $val = $client_sock; (SERVER DATA) chomp $val; if ($val ne '') { $buf = SUCCESS; } else { $buf = FAILURE; } } #send msg to client print $client_sock $buf\n; } exit; } continue { close $client_sock; } Normal Client Code Snippet: while ($TRUE) { $MySocket = new IO::Socket::INET( PeerAddr = $ServerName, PeerPort = $port, Proto= 'tcp'); if (!$MySocket) { print Failed to Connect to Server: $ServerName\n; print Trying to connect again after 10 seconds\n; sleep (10); next; } else { last; } } print Connected to \n; print Processing ...\n; while ($TRUE) { print $MySocket NORMAL_CLIENT_.$host\n; $Message = $MySocket; chomp $Message; if ($Message eq ''}) { print NULL Msg from Server. Polling after (time in seconds): ,$TIME_DELAY * $ONE_MINUTE,\n; sleep ($TIME_DELAY * $ONE_MINUTE ); } else { print Msg from Server: $Message\n; } }#end of while close $MySocket; Master Client Code Snippet: while ($TRUE) { $MySocket = new IO::Socket::INET( PeerAddr = $ServerName, PeerPort = $port, Proto= 'tcp'); if (!$MySocket) { print Failed to Connect to Server: $ServerName\n; print Trying to connect again after 10 seconds\n; sleep (10); next; } else { last; } } print Connected to \n; print Processing ...\n; print $MySocket MASTER_CLIENT_.$host\n; print $MySocket $Information\n; #this msg has to be sent to Server where all other Normal clients are waiting for this info $Message = $MySocket; chomp $Message; print Msg from Server: $Message\n; close $MySocket; Thanks in advance Suresh
[Free Disk Space] : in Windows using perl
Hi, Is there anyway to find out Free Disk Space in Windows using PERL? Assume I have a function say GetFreeDiskSpace(). I can specify some path as a parameter to GetFreeDiskSpace() and want to get the return value in bytes for available disk. The path can contain Local Drive Name or Share Name or Shared IP Address. Further enhancement to this can be, I pass second parameter to it for specifying the how the return value should be i.e. Bytes or Kilo Bytes or Mega Bytes etc. Regards ~Suresh Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.