RE: passing parms to subroutine
Title: RE: passing parms to subroutine Look for dereferencing. Section 4.8.2 in Perl in a Nutshell -Original Message- From: lorid [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 29, 2003 2:14 PM To: Moon, John Cc: perl users Subject: Re: passing parms to subroutine Thanks. I didnt see anything about the $$ for refering to the value in my book , but then again Im in a hurry. anyway - I get it, it works now Lori Moon, John wrote: SUN1-BATCHperl -e 'my $a=abc; Show(\$a);sub Show {my SUN1-BATCH($value)[EMAIL PROTECTED];print value=$$value\n;}' value=abc SUN1-BATCH Hope this helps ... jwm -Original Message- From: lorid [mailto:[EMAIL PROTECTED]] Sent: October 29, 2003 14:31 To: perl users Subject: passing parms to subroutine Im used to subs in C or VB but this has me puzzled... I am trying to pass a scalar ref to a subroutine, When I try to use the value of the passed parm inside the sub Im getting a garbage value (has address instead of value? ) from my process_files sub,and the increment sub, but the sub that I dont declare a prototype on or use () in the func. definition It works ?? Can someone spot my error, or tell me the right way to pass a scalar to a sub and use it ? #!/usr/bin/perl -w use warnings; use strict; #prototypes sub increment(\$); sub process_files(\$); my $a= 5; my $pc_unzipped_file = 'C:\\TMCC\\CIT_153\\hw9\\hw9_files\\CNUTLZD.TXT'; increment($a); print $a; process_files($pc_unzipped_file); my $a= 5; my $pc_unzipped_file = 'C:\\TMCC\\CIT_153\\hw9\\hw9_files\\CNUTLZD.TXT'; increment($a); print $a; process_files($pc_unzipped_file); #function defs sub increment(\$){ my $reference = shift; print \nThe reference:$reference\n; print \nThe reference:@_\n; $$reference++; } sub process_files(\$){ my $file_ref = shift; print \nGot the Filename: $file_ref \n; print \nGot the Filename: @_\n; } first (1,2,3); sub first #how come no () here ? , also I notice they dont create a prototype { print \nIn first the ars are @_\n; # this allows me to get at values inside the sub which is what I need. } Thanks Lori ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
reading/writing to a ascii file
Title: reading/writing to a ascii file Ok guys here is the pickle I'm in now =-) I need to read from a ASCII file and only modify the lines that match a variable. I do not want to read the entire file into memory and write the entire file out each time I need to make a change. Here is what I am doing that reads the entire file and re-writes the entire file: $var1 = '106253498'; open(FILE, my.file); @file = FILE; close(FILE); open(FILE, my.file); chomp @file; foreach my $line (@file){ if ($line =~ /^$var1\|/){ #do my data changes $line = asdf1234;#where asdf1234 is my changes } print FILE $line . \n; } close(FILE); Can anyone offer a suggestion? My issue is that the data that is coming in is x length (where x is a dynamic space) and the value I am writing back to the line can be a max of x+10 and a min of x-10..
RE: reading/writing to a ascii file
Title: RE: reading/writing to a ascii file That is still opening and reading the entire file and then creating an entire new file... I may run into instances where the file will be opened and modified many times. -Original Message- From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 28, 2003 9:53 AM To: 'Farrington, Ryan'; [EMAIL PROTECTED] Subject: RE: reading/writing to a ascii file Ryan, it's easier than you think: open(IN, $inputfile) or die can't open $inputfile: $!; open(OUT,$outputfile) or die can't open $outputfile: $!; while (IN){ s/$string/$replacement/g; print OUT $_; } close IN; close OUT; rename($outputfile, $inputfile) or die can't rename... $!; -- Mark Thomas [EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;;
RE: CGI Script permissions to call scripts on another server
Title: Message Michael, The user that apache runs as is the user you need to give access to that share... ex: my machine runs apache as a domain account. If I give that user access to a network share I can access the files in it... -Original Message-From: Rafala, Michael [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 12:48 PMTo: [EMAIL PROTECTED]Subject: CGI Script permissions to call scripts on another server I've got a CGI network permissions problem I've got to solve, and I'm wondering if I can do it from within my CGI script (or any other way): A Perl CGI script (Win32/Apache) calls a .bat file. I've tried putting the .bat file in various places: -- This works fine if the .bat file is in the same folder as the cgi script: system( 'test.bat' ); -- This works fine too (c:\ is the root of the host machine): system( 'c:\myfolder\test.bat' ); -- But this doesn't work: system( '//AnotherServer/myfolder/test.bat' ); The apache error log shows a "permission denied" message for the client IP address (the ip of the person making the cgi call). When I change permissions on //AnotherServer/myfolder to include "Everyone", the batch file runs. The problem is, my systems administrator won't be thrilled to see that "Everyone" group there. Is there a way to have my CGI script log on as a specific user (with permissions) before making the system() call? Or some other solution? Setting an Apache ScriptAlias doesn't seem to help. I'm afraid I'm not much of a network guy, so I hope this makes sense. Michael Rafala Cadmus Professional Communications [EMAIL PROTECTED] 410-691-6445 410-691-6939 fax
RE: Win32::ODBC Question
Title: RE: Win32::ODBC Question I think the best way to do this would be to hit the registry and look at ODBC.ini -Original Message- From: Martin, Stanley G [GMG] [mailto:[EMAIL PROTECTED]] Sent: Friday, August 01, 2003 10:50 AM To: perl-win32-users (perl-win32-users) Subject: Win32::ODBC Question I have to move a ton of ODBC Connections from one box to another and was wondering if in this module there is a way to get all the attributes for a particular ODBC Connection so that I can turn around and insert it onto the other. I have Dave Roth's Standard Extensions book, but can't find anything that pulls all this info out, just how to put it in. Stanley G. Martin System Administrator Sprint - EIS3 Customer Care [EMAIL PROTECTED] ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Page generation tweeking
Title: Page generation tweeking Ok I have a page that reads 2 files into arrays. Pretty simple stuff like this: open(FILE, file1.txt); @file1 = FILE; close(FILE); open(FILE, file2.txt); @file2 = FILE; close(FILE); Now file1 contains a complete list of users. And file2 contains a list of specific users. What I really want in the long run is to output the complete user list into a select/select form on a webpage... Below is what I currently have: --- CODE --- $count = 0; MEMBER:foreach my $curmem (@memberlist) { $curmem =~ s/[\n\r]//g; my $there = 0; NOTE:foreach my $note (@notify){ $note =~ s/[\n\r]//g; if($note eq $curmem){ $there = 1; last NOTE; } } if($there){ $memberlist_htmlvar .= qq~option selected value=$curmem$curmem/option~; } else { $memberlist_htmlvar .= qq~option value=$curmem$curmem/option~; } } --- END CODE --- Now my problem is this: the above code works fine when I have to write it 3-4 times. But when I have it being written more then that the page slows down drastically. Ideally what I would like is a single variable that generates the option list once then have some dynamic way of checking it against the @notify array and marking it selected if it exists. BTW each time I get to the notify section I have to read a different file depending on where I am at in the loop. So the memberlist stays constant and the notify is dynamic. Ex: --- bad code no flames =)--- ##before initial loop starts generate the member list with a variable I want filled in when I make reference to the variable foreach my $curmem (@memberlist) { $curmem =~ s/[\n\r]//g; $memberlist_htmlvar .= qq~option $hash{$curmem} value=$curmem$curmem/option~; } ##during loop %hash = (); NOTE:foreach my $note (@notify){ $note =~ s/[\n\r]//g; $hash{$note} = selected ; } Print $memberlist_htmlvar; # I would like this to output the memberlist_htmlvar but have the $hash{$curmem} #filled in with the new variables Anyone have thoughts?
RE: REWRITE RE: Error trapping
Title: RE: REWRITE RE: Error trapping Grrr still didn't catch the error =( -Original Message- From: Burak Gürsoy [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 17, 2003 1:06 PM To: [EMAIL PROTECTED] Subject: RE: REWRITE RE: Error trapping ok, try this one: #!/usr/bin/perl -w use strict; BEGIN { $| = 1; $SIG{__DIE__} = sub my $msg = shift; EventLogger(PERL Service, error, 666, $msg\n\n); exit; }; } # add your code here... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Farrington, Ryan Sent: Thursday, July 17, 2003 4:18 PM To: '[EMAIL PROTECTED]' Subject: REWRITE RE: Error trapping Ok so now here is the stumper for me... I used [code] Local $SIG{__DIE__} = sub my $msg = shift; EventLogger(PERL Service, error, 666, $msg\n\n); exit; }; [/code] And it died again today but no event written =( if it dies in a module will this catch it? -Original Message- From: Burak Gursoy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 15, 2003 1:52 PM To: [EMAIL PROTECTED] Subject: RE: Error trapping it is $SIG{__DIE__} actually... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Carl Jolley Sent: Tuesday, July 15, 2003 7:39 PM To: FARRINGTON, RYAN Cc: [EMAIL PROTECTED] Subject: Re: Error trapping On Mon, 14 Jul 2003, FARRINGTON, RYAN wrote: Ok I have a perl script that has been compiled as an executable and is running on a 2K server as a service. Now the problem is that it is die'ing without generating an error. Is there anyway to trap the die and then have it output it to a function before actually die'ing? Have you tried to define a $SIG{DIE} subroutine? [EMAIL PROTECTED] Carl Jolley All opinions are my own and not necessarily those of my employer ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: How to edit an FTPed HTML page?
Title: RE: How to edit an FTPed HTML page? Example: Computer 1 (your computer) Script.pl |--- get file and store it in c:\temp Computer 2 (their computer) Script.pl |--- get file and store it in c:\temp I don't see why it would download to your machine unless you have a UNC path somewhere -Original Message- From: ashish srivastava [mailto:[EMAIL PROTECTED]] Sent: Friday, July 11, 2003 9:38 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: How to edit an FTPed HTML page? Hi I am able to FTP the file to any local directory on 'MY Machine'. But the application should be such that any user can FTP the file to a fixed location on HIS m/c (say C:\Temp. I will make sure that all the users have this directory on their sys.). Then he should edit it and upload it. At present when other users download the file, it is getting downloaded to my dir (say C:\temp). Ashish From: FARRINGTON, RYAN [EMAIL PROTECTED] To: 'ashish srivastava' [EMAIL PROTECTED], [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: RE: How to edit an FTPed HTML page? Date: Fri, 11 Jul 2003 09:30:14 -0500 Ashish just make sure it saves it to a local drive. Ex: c:\temp\perl_ftp\your.html -Original Message- From: ashish srivastava [mailto:[EMAIL PROTECTED]] Sent: Friday, July 11, 2003 9:04 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: How to edit an FTPed HTML page? Hi Another doubt. My script is running on a server installed on my machine. Now when i FTP a file it will be downloaded to a particualr directory. But what when other people use this script? I want the file to be downloaded to their local machines and not on my machine. How can i do this? TIA Ashish From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: How to edit an FTPed HTML page? Date: Fri, 11 Jul 2003 10:00:52 +0100 On 11/07/2003 08:13:32 perl-win32-users-admin wrote: Hi All My application needs to edit an HTML page which is located on a remote server(UNIX). I can FTP the particular file to my local directory, but can i open this file in Netscape Composer through a Perl script? Sure, system() should be able to do it: # assume file was FTPs to $localfilepath system( qq(c:/program files/netscape/netscape.exe -edit $localfilepath) ); (adjust accordingly for netscape location and the correct switch for Composer) Note: this will block your script until you exit Composer. -- Csaba Ráduly, Software Engineer, Sophos Anti-Virus Email: [EMAIL PROTECTED], Tel: 01235 559933, Web: www.sophos.com Add live virus info to your website: http://www.sophos.com/link/vfeed ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _ Astrology can be fun. Find out for yourself. http://www.msn.co.in/Astrology/Astromagic/ With just a click! ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _ Polyphonic ringtones. Latest movie trailors. http://server1.msn.co.in/sp03/gprs/index.asp On your mobile!
RE: Re[2]: OH NOOO SPAM ATTACK!
Title: RE: Re[2]: OH NOOO SPAM ATTACK! John... The only problem with that solution is that is requires sendmail and A UNIX-like operating system what about us poor schmucks that #1 run a Microsoft OS and #2 don't have access to the mail server? =) -Original Message- From: John Mason Jr [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 10, 2003 1:28 PM To: 'Lee Goddard' Cc: [EMAIL PROTECTED] Subject: RE: Re[2]: OH NOOO SPAM ATTACK! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Lee Goddard Sent: Thursday, July 10, 2003 12:28 PM To: =James Birkholz= Cc: [EMAIL PROTECTED] Subject: Re[2]: OH NOOO SPAM ATTACK! Hi =James, On Thursday, July 10, 2003 at 3:42:24 PM, you wrote: JB This is not spam. It's a subscriber to this list who has made the JB ill-advised choice to use a spam-blocking service. Why doesn't the service check the mail headers for the list or bulk setting and ignore such posts? And is there an open-source anti-spam program in perl? And if not, why not? (No, I'd rather not pay ActiveState.) Links to setting up a antispam and antivirus open source server http://linux-sxs.org/index2.html And from the creator of mimedefang http://www.roaringpenguin.com/mimedefang/ http://www.mimedefang.org I would also recommend checking out http://www.canit.ca The commercial product based on mimedefang, it allowed me to get this up and running very quickly and the tech support was awesome. John Mason ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: download patches.
Title: RE: download patches. Janardhan, We are working on the same solution... The XML file from shavlik is a little better to play with but microsoft in their infinate wisdom allowed Shavlik to make the XML file so convoluted that it is almost imposible (from my side at least) to get the correct files... What I do is use the XML files from microsoft and shavlik to get the newest bulletins and then use code to compare what the server/workstation has against a hand coded standard. works ok for us.. -Original Message- From: Molumuri, Janardhan [mailto:[EMAIL PROTECTED]] Sent: Monday, July 07, 2003 11:09 PM To: '[EMAIL PROTECTED]' Subject: download patches. Hi all, Can we automatically download patches, by parsing HFnetchk output and XML file. Thanks, --janardhan. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: DBI Count Distict
Title: RE: DBI Count Distict I would use the SQL server to make the counts for me... or you could take the query then make a hash using the first three digits as the key and make the value increment... then you just hash through the hash (hehehe) and get your final count... -Original Message- From: steve silvers [mailto:[EMAIL PROTECTED]] Sent: Friday, June 27, 2003 8:52 AM To: [EMAIL PROTECTED] Subject: DBI Count Distict Quick question I'm calling out a column called data which looks like so: 001A 001B 002A 002D 003D 003E 004A 005 I need to get the count of all 001 and 002 and 003... so on where 001 = 2 and 002 = and 004 = 1... I have $sql = SELECT Data FROM table; while (($Data) = $sth-fetchrow_array) { print $Data \n; } Any help greatly appreciated. Thanks in advance Steve _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Creating interactive process on remote clients with WMI
Title: RE: Creating interactive process on remote clients with WMI truthfully a good way around this is to create the process as a scheduled job (using WMI) and make sure it is set to go off 1-2 mins ahead of the current time... we use it and from what I can tell a lot of Microsoft Certified Partners do the same tasks when dealing with remote installs and other processes that may require a interactive session on the remote machine... =) hope this helps -Original Message- From: Scott Campbell [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 25, 2003 6:46 AM To: 'Jangale V-S SPEL-TIT'; [EMAIL PROTECTED] Subject: RE: Creating interactive process on remote clients with WMI I have tried to do this, and emailed the forum, but with no reponse. From all my reading of the msdn site, it appears that when creating remote processes via WMI, they cannot be interactive, for security reasons. If creating a process locally via WMI, it can be interactive. Someone may correct me if I'm wrong, but this is where I ended up. Scott Campbell Senior Software Developer Somix Technologies http://www.somix.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jangale V-S SPEL-TIT Sent: Wednesday, June 25, 2003 7:02 AM To: '[EMAIL PROTECTED]' Subject: Creating interactive process on remote clients with WMI Dear All, I am using W2K, SP3 I trying to launch a process on remote computer using WMI. However this process need to interactive. Following is my attempt use Win32::OLE qw( in ); use Win32::OLE::Variant; $Machine = . unless( $Machine = shift @ARGV ); $Machine =~ s#^[\\/]+## if( $Machine =~ m#^[\\/]{2}# ); $CLASS = WinMgmts:{impersonationLevel=impersonate}!//$Machine; $WMI = Win32::OLE-GetObject( $CLASS ) || die Unable to connect to $Machine: . Win32::OLE-lastError(); $PROCESSSTARTUP = $WMI-Get(Win32_ProcessStartup)-SpawnInstance_; $PROCESSSTARTUP-{WinstationDesktop} = winsta0\\default; $PROCESSSTARTUP-{ShowWindow} = 1; print $PROCESSSTARTUP-{WinstationDesktop}\n; $Process = $WMI-Get( Win32_Process ) || die Unable to get the process list: . Win32::OLE-LastError(); $vPid = Variant( VT_I4 | VT_BYREF, 0 ); $test =join( , @ARGV ); if( 0 == $Process-Create( join( , @ARGV ), undef, $PROCESSSTARTUP, $vPid ) ) { print Process successfully created with PID $vPid\n; } else { print Failed to create process.\n; } However, the process created on remote desktop is not interactive ! How can I make the process interactive ?? With Best Regards, V.S. Jangale ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Changing Default Gateway
Title: RE: Changing Default Gateway you could use WMI if you are working with a WIN32 system... but if your hitting an NT 4 box it will not take effect until the next reboot =) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 25, 2003 10:34 AM To: Wingfield, Nancy Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: Re: Changing Default Gateway I think you should be able to use the route command line program. You'll have to do a route DELETE of the default entry and then route ADD for the new way out. You can use route PRINT to get a look at your current routing table. -- Nick Ayoub [EMAIL PROTECTED], [EMAIL PROTECTED] IS - Systems and Operations, TEL 480-792-7275, FAX 480-792-4054 Microchip Technology, 2355 W. Chandler Blvd., Chandler AZ 85224-6199 http://www.microchip.com |-+--- | | Wingfield, Nancy | | | [EMAIL PROTECTED] | | | Sent by: | | | [EMAIL PROTECTED]| | | veState.com | | | | | | | | | 06/25/2003 12:18 PM | | | | |-+--- ---| | | | To: '[EMAIL PROTECTED]' | | [EMAIL PROTECTED] | | cc: | | Subject: Changing Default Gateway | ---| Hi Discussion Group, I'm wondering if anyone knows whether it is possible to change the default gateway, and not have to reboot in order for the changes to take effect...I figured out how to change the default gateway, but I have to reboot before the changed default gateway is used. Anyone have any ideas?? Thanks, Nancy Wingfield ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Displaying a status bar
Title: RE: Displaying a status bar I don;t think there is really a way unless u use a flash front end to start the perl script running then take the output from the perl script and use that to make your determination... flash has some kewl content tools... =) -Original Message- From: Hsu, David [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 25, 2003 1:06 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Displaying a status bar Hello, Can someone let me know of a method of displaying a status bar on screen(html) in Perl script while it is processing a task. I have tried to print html, but it won't display the image until it has finished processing, and then it displays with the rest of the information. _javascript_ is an option, but if the status screen is selected into the background, it will never close. Thanks, David ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Couple questions (alarm(), nested loops)
Title: Couple questions (alarm(), nested loops) ok does ActiveState implement something like alarm() in the win32 version? and if I have nested loops: foreach $var(@vars){ foreach $stuff (@stuffs){ } } how do I make the second loop force the first loop to go to the next instance. I know next works in the first loop but if I do that in the second it only affects the second loop =(
Win32::OLE 5.6?
Title: Win32::OLE 5.6? has anyone seen the following error when trying to connect to a database using a connect string? the connection works for something like 50 connections then dies then comes back eventually... Any ideas? OLE exception from Provider: Unspecified error Win32::OLE(0.1403) error 0x80004005: Unspecified error
Win32::OLE
Title: Win32::OLE ok I have a script that uses Win32::OLE(ADODB.Connection) to connect to a MSSQL 2K database server and I was just playing with the query analyser provided by Microsoft with the client components. When u run a query it returns (x) rows effected [or something like that] I would like to get this returned to the script. Anyone have ideas?
RE: Win32::OLE
Title: Win32::OLE the unfortunate thing about that is what happens when the row count is above 100mil [takes FOREVER =)], or your doing an update [no change] =( -Original Message-From: Bullock, Howard A. [mailto:[EMAIL PROTECTED]]Sent: Friday, January 10, 2003 3:02 PMTo: 'FARRINGTON, RYAN'Subject: RE: Win32::OLE You should execute the following SQL to determine the row count before actually executing the SQL to return data. Select count(*) from ... Howard A. Bullock Global IT Infrastructure 717-810-3584 -Original Message-From: FARRINGTON, RYAN [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 3:57 PMTo: [EMAIL PROTECTED]Subject: Win32::OLE ok I have a script that uses Win32::OLE(ADODB.Connection) to connect to a MSSQL 2K database server and I was just playing with the query analyser provided by Microsoft with the client components. When u run a query it returns (x) rows effected [or something like that] I would like to get this returned to the script. Anyone have ideas?
perl -w script ?
Title: perl -w script ? ok, So when I run perl -w load.pl I get the following... the script runs great but I was just surfing around and I found a perl scrits should always be run with -w ex: perl -w so I tried it and now i'm a little worried about the output =-( can anyone help me out? line 5 is my script is use Win32::Lanman; Subroutine SERVICE_ACCEPT_STOP redefined at d:/Perl/lib/Exporter.pm line 57. Exporter::import('NET_INFO_DESCRIPTION', 'NET_STATUS_DESCRIPTION', 'SERVICE_CONTROL_DESCRIPTIONS', 'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SERVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...) called at load.pl line 5 main::BEGIN() called at d:/Perl/site/lib/Win32/Lanman.pm line 5 eval {...} called at d:/Perl/site/lib/Win32/Lanman.pm line 5 Subroutine SERVICE_ACCEPT_PAUSE_CONTINUE redefined at d:/Perl/lib/Exporter.pm line 57. Exporter::import('NET_INFO_DESCRIPTION', 'NET_STATUS_DESCRIPTION', 'SERVICE_CONTROL_DESCRIPTIONS', 'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SERVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...) called at load.pl line 5 main::BEGIN() called at d:/Perl/site/lib/Win32/Lanman.pm line 5 eval {...} called at d:/Perl/site/lib/Win32/Lanman.pm line 5 Subroutine SERVICE_ACCEPT_SHUTDOWN redefined at d:/Perl/lib/Exporter.pm line 57. Exporter::import('NET_INFO_DESCRIPTION', 'NET_STATUS_DESCRIPTION', 'SERVICE_CONTROL_DESCRIPTIONS', 'SERVICE_STATE_DESCRIPTIONS', 'SERVICE_CONTROLS', 'SERVICE_START_TYPES', 'SERVICE_ERROR_TYPES', 'SC_FAILURE_ACTIONS', ...) called atload.pl line 5 main::BEGIN() called at d:/Perl/site/lib/Win32/Lanman.pm line 5 eval {...} called at d:/Perl/site/lib/Win32/Lanman.pm line 5
RE: Source-Code-Protection
Title: RE: Source-Code-Protection Harald, Perl2exe http://www.indigostar.com is shareware but you can always use it to make executables... I use it for the same reason here at the office and I make sure I am the only person with access to the source... -Original Message- From: Harald Wopenka [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 31, 2002 7:01 AM To: Morbus Iff; [EMAIL PROTECTED] Subject: AW: Source-Code-Protection Jep, I know. I like Open-Source. But sometimes there are some people grabbing your work and telling people its theirs... I cases like that some protection comes in very handy... -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Morbus Iff Gesendet: Donnerstag, 31. Oktober 2002 13:54 An: Harald Wopenka; [EMAIL PROTECTED] Betreff: Re: Source-Code-Protection I think its a common problem with Perlprogs that u cant hide your That's a feature. Working around this feature will earn you scorn. -- Morbus Iff ( now in fun bath toy! ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Can't locate Date/Format.pm
Title: Message Mark, Here comes a stupid question. Did you extract it? If so it created a directory named 'TimeDate-1.1301' under that you'll see 2 directories and 4 files... you have 2 choices... you can either type the following: perl makefile.pl nmake nmake test nmake install I've attached my version of nmake (you can find another if you don't trust me, also I've renamed it to .txt from .exe) or you can just be brave and just copy the files from /lib to the following locations %perl_path%\site\lib\Time\Zone.pm%perl_path%\site\lib\Date\Format.pm%perl_path%\site\lib\Date\Language.pm%perl_path%\site\lib\Date\Parse.pm%perl_path%\site\lib\Date\Language\Austrian.pm%perl_path%\site\lib\Date\Language\Czech.pm%perl_path%\site\lib\Date\Language\Dutch.pm%perl_path%\site\lib\Date\Language\English.pm%perl_path%\site\lib\Date\Language\French.pm%perl_path%\site\lib\Date\Language\German.pm%perl_path%\site\lib\Date\Language\Italian.pm%perl_path%\site\lib\Date\Language\Norwegian.pm or you could always find it on PPM inside PPM type: search TimeDate install TimeDate and that will install a cut down version with only French as an alternate language. -Original Message-From: Ricci, Mark [mailto:[EMAIL PROTECTED]]Sent: Wednesday, October 30, 2002 10:09 AMTo: 'FARRINGTON, RYAN'; '[EMAIL PROTECTED]'Subject: RE: Can't locate Date/Format.pm Thanks, Ryan. I was able to download it. But what directory do you install it in. I copied it here: c:\perl\site\lib\ and here: c:\perl\site\win32 but I'm getting the same error about not being able to find the pm. Mark -Original Message-From: FARRINGTON, RYAN [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 30, 2002 9:37 AMTo: '[EMAIL PROTECTED]'Subject: RE: Can't locate Date/Format.pm http://search.cpan.org/author/GBARR/TimeDate-1.1301/ look at download 1/4 down the page... -Original Message- From: Ricci, Mark [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 30, 2002 8:20 AM To: '[EMAIL PROTECTED]' Subject: Can't locate Date/Format.pm Hello, I can't seem to find this module: use Date::Format; Any pointers where it might be located? Thanks, Mark This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message. Thank you. WordWave, Capturing the Power of the Spoken Word http://www.wordwave.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. If you are not the intended recipient, please contact the sender by reply and destroy all copies of the original message. Thank you. WordWave, Capturing the Power of the Spoken Word http://www.wordwave.com
RE: merging two tabseparated text files.
Title: RE: Terrible at my logic your data does not match with the info... =( -Original Message-From: Mohanty, Debi (MED, TCS) [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 29, 2002 12:46 PMTo: [EMAIL PROTECTED]Subject: merging two tabseparated text files. Hi, Please any one suggest how can I add two tabseparated text files in to one tabseparated text file. In the text file 1 and the text file2 One column is common to both the files. So Is there any way by comparing the record no (which is present in both the files), I will be generate a single file. As per example :- File 1:-- Orig Report #Author PhoneAuthor employee #Author nameCustomer CountryOrig Created By **1026921Y7317KAKIZAWA,TSUYOSHIJAPANKIDOKORO,MIYUKI1026922Y7677TAKAAKI,TOBEJAPANTAKAAKI,TOBE1026923843421EXPOSITO,JEAN-PIERREFRANCEEXPOSITO,JEAN-PIERRE102692414502ROULLEAU DENISFRANCEROULLEAU,DENIS10269259PERRET, DENISFRANCEPERRET, Denis10269269PERRET, DENISFRANCEPERRET, Denis10269273290THOMAS, JULIANUNITED KINGDOMThomas, Julian10269282545MURTON,BOBIRELANDMURTON,BOB File2:- Orig Report #Actions TakenProblem DescriptionInvestigation SummaryValidation of EffectivenessTask notes1026921Kanto U/S, Yokoyama-sanEOLOn EchopacEOL*** NOTES FROM: KIDOKORO,MIYUKI *** 020701EOLSHR-02G-009EOL1026922EOLNeed the evaluation EOLERROR 38 appeared. She checked the cassette correctly mounted and tried theEOL(barak Jul.2,2002) Status to EVAL.EOLEOLEOL1026923We must get theEOLThe systeme can make only fluoro with the We have error 4A6B and the collimator board failed led (Michel Le Morvan, 02 July 2002) Deter*** NOTES FROM: LE_MORVAN,MICHEL *** 020708EOL1026924this type of power supply is no more dc outputs on power supply*** NOTES FROM: KRISTOFFERSEN,JAN *** 0207051026925Je pense qu'il serait preferable de realiser cette operationEOLavant l'arrivee chez le client.Perte de temps durant l'installation (Michel Le Morvan, 02 July 2002) Determined *** NOTES FROM: "DDTs-to-CQA" *** 020702EOL102690this type of power supply is no more dc outputs on power supply*** NOTES FROM: KRISTOFFERSEN,JAN *** 020705192345this type of power supply is no more dc outputs on power supply*** NOTES FROM: KRISTOFFERSEN,JAN *** 020705 Please help me on this issue. ThanksRegards Debi
RE: Terrible at my logic
Title: RE: Terrible at my logic Hari, Joseph is hitting it on the head... *warning sloppy code ahead* the following code worked like a champ for me on all the provided inputs... @str = (250 80707 13 294 8, 332 0 286 5 428 0, 332 0 286 5 428 0, 414 9 428 0 797 , 333 0 781 2 458 9 , 414 01286 9 784 7 , 280 9 428 0 281 0 , 428 0 487 0 458 0 , 486 797 , 239 5 789 00 269 9 , 239 5 789 00 269 9 , 281 0 , 250 82707 15 401 9 , 486 286 9 250 00788 30787 2 , 486 286 9 250 00788 30787 2 , 707 0 788 20 340 , 707 0 788 20 340 , 788 20496 , 788 20496 , 812 20, 719 45781 2 , 707 14788 21 414 9 355 8 344 1 , 707 14788 21 414 9 355 8 344 1 , 805 4 724 2 781 2 719 41, 788 30781 2 427 31820 8 , 428 0 401 9 781 2 , 239 0 787 2 998 3 427 31511 9 , 894 1 788 29 599 0 716 99, 894 1 788 29 599 0 716 99); foreach $str (@str){ my $num = '6'; for(my $i = 0; $i = 42; $i += 6) { if($i eq '18'){ $num = '7'; } else { $num = '6'; } print substr($str, $i, $num); unless($i eq '12'){ print ; } if ($i eq '18'){ $i++; } } print \n; } -Original Message- From: Krishna, Hari [mailto:[EMAIL PROTECTED]] Sent: Friday, October 25, 2002 10:37 AM To: 'Sisyphus'; [EMAIL PROTECTED] Subject: RE: Terrible at my logic The length has no significance as far as I am concerned. But each set of numbers belong to A line only. So the length of each input line may vary. Let me post how the input file looks like. 250 80707 13 294 8 332 0 286 5 428 0 332 0 286 5 428 0 414 9 428 0 797 333 0 781 2 458 9 414 01286 9 784 7 280 9 428 0 281 0 428 0 487 0 458 0 486 797 239 5 789 00 269 9 239 5 789 00 269 9 281 0 250 82707 15 401 9 486 286 9 250 00788 30787 2 486 286 9 250 00788 30787 2 707 0 788 20 340 707 0 788 20 340 788 20496 788 20496 812 20 719 45781 2 707 14788 21 414 9 355 8 344 1 707 14788 21 414 9 355 8 344 1 805 4 724 2 781 2 719 41 788 30781 2 427 31820 8 428 0 401 9 781 2 239 0 787 2 998 3 427 31511 9 894 1 788 29 599 0 716 99 894 1 788 29 599 0 716 99 Here's how my output should look like: 250 80 707 13 294 8 332 0 286 5 428 0 332 0 286 5 428 0 414 9 428 0 797 333 0 781 2 458 9 414 01 286 9 784 7 280 9 428 0 281 0 428 0 487 0 458 0 486 797 239 5 789 00 269 9 239 5 789 00 269 9 281 0 250 82 707 15 401 9 486 286 9 250 00788 30 787 2 486 286 9 250 00788 30 787 2 707 0 788 20 340 707 0 788 20 340 788 20 496 788 20 496 812 20 719 45 781 2 707 14 788 21 414 9 355 8 344 1 707 14 788 21 414 9 355 8 344 1 805 4 724 2 781 2 719 41 788 30 781 2 427 31820 8 428 0 401 9 781 2 239 0 787 2 998 3 427 31 511 9 894 1 788 29 599 0 716 99 894 1 788 29 599 0 716 99 But MY LOGIC GIVES ME THE FOLLOWING OUTPUT (Iam cutting an pasting from the wordpad exactly as is..): 250 80 707 13 294 8 332 0 286 5 428 0 332 0 286 5 428 0 414 9 428 0 797 333 0 781 2 458 9 414 01 286 9 784 7 280 9 428 0 281 0 428 0 487 0 458 0 486 797 239 5 789 00 269 9 239 5 789 00 269 9 281 0 250 82 707 15 401 9 486 286 9 250 0 0788 3 0787 2 486 286 9 250 0 0788 3 0787 2 707 0 788 20 340 707 0 788 20 340 788 20 496 788 20 496 812 20 719 45 781 2 707 14 788 21 414 9 355 8 344 1 707 14 788 21 414 9 355 8 344 1 805 4 724 2 781 2 719 4 1 788 30 781 2 427 3 1820 8 428 0 401 9 781 2 239 0 787 2 998 3 427 3 1511 9 894 1 788 29 599 0 716 9 9 894 1 788 29 599 0 716 9 9 Hope this might help you guys to help me out with the problem. Thanks a lot. Regards, Hari. -Original Message- From: Sisyphus [mailto:[EMAIL PROTECTED]] Sent: Friday, October 25, 2002 10:23 AM To: [EMAIL PROTECTED] Subject: Re: Terrible at my logic - Original Message - From: Krishna, Hari [EMAIL PROTECTED] Heres my input: 486 286 9 250 00788 30787 2 This is different to the input you originally posted. (It is only 32 characters long.) Just thought I'd pont that out in case it has a bearing on the solution to this problem :-) Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl IDE..
Title: RE: Perl IDE.. Komodo 1.1 is free!!! =) I'll see if I can find my download of it and then I'll send out a link to where u can download it =) -Original Message- From: David Kaufman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 23, 2002 9:17 AM To: [EMAIL PROTECTED]; Stephen Gray Subject: Re: Perl IDE.. Stephen Gray [EMAIL PROTECTED] wrote: Is there a favourite Perl IDE for Win 95... or are there too many to have a defined winner ?? I'm just getting into Perl, so I just need the basics... also, code will only be executed on Windows. Interested in exploring how perl interacts with the o/s and ole. Thanks. ActiveState Komodo is great: http://activestate.com/Products/Komodo/ ...not free, mind you. but great. -dave ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl IDE..
Title: RE: Perl IDE.. I also found that PrimalScript is a good Perl editor =) -Original Message- From: Joao Vieira da Cunha [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 23, 2002 9:23 AM To: [EMAIL PROTECTED] Subject: Re: Perl IDE.. I've been using the OpenPerl IDE from SourceForge. It's not Komodo, but if you're just getting into perl, it's a good first step. http://open-perl-ide.sourceforge.net/ Joao MIT / Sloan At 10:16 23/10/2002 -0400, you wrote: Stephen Gray [EMAIL PROTECTED] wrote: Is there a favourite Perl IDE for Win 95... or are there too many to have a defined winner ?? I'm just getting into Perl, so I just need the basics... also, code will only be executed on Windows. Interested in exploring how perl interacts with the o/s and ole. Thanks. ActiveState Komodo is great: http://activestate.com/Products/Komodo/ ...not free, mind you. but great. -dave ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: msvc++ and environment variables
Title: RE: msvc++ and environment variables try set from a command prompt that will output every environment varible... -Original Message- From: Sisyphus [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 08, 2002 1:59 PM To: [EMAIL PROTECTED] Subject: msvc++ and environment variables Hi, Not strictly a perl issue but: My vcvars32.bat file (which sets the environment for compilation) contains some lines like these: set path= various folders;%path% set include= other folders;%include% set lib = different folders;%lib% I can get a listing of the folders in the path by simply entering 'path' at a command prompt. But both 'include' and 'lib' (when entered at a command prompt) are not recognized as an internal or external command, operable program or batch file. How can I obtain a listing of the folders in 'lib' and 'include' ? This has been puzzling me for some time . thought I would have stumbled over the answer by now . but I haven't :-( Cheers, Rob ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs