Hi, i wonder how to remove the 4 first lines of a file in Perl?
How does this admittedly lazy-brained script work for you?:
---
open(IN,filetosnip.txt) or die $!;
open(OUT, tempfile.txt) or die $!;
$line = IN;$line = IN;$line = IN;$line = IN;
while($line = IN) {
print OUT $line;
}
[EMAIL PROTECTED] wrote, on Thursday, October 31, 2002 7:56 AM
: Hi, i wonder how to remove the 4 first lines of a file in Perl?
Assuming you've set up IN and OUT as filehandles:
my $i = 0;
while IN {
if ($i 4) {
$i++;
} else {
print OUT $_;
The below Perl snippet keeps giving me prototype mismatch errors. The script
runs via command line to change the wins entries.
ERRORS
Prototype mismatch: sub main::NULL () vs none at (eval 1) line 5.
Constant subroutine NULL redefined at (eval 1) line 5.
Prototype mismatch: sub
I've seen this problem when I include the line:
use Win32;
To get around it, whenever I use a function from Win32 I simply fully
qualify it.
Ex. $machine = Win32::NodeName();
I can then remove the 'use Win32' line.
Stanley G. Martin
Sprint - ISS Enterprise App/Decision Support Services
hello,
I am implementing a queue, using shift and push to put and remove elements
from an array.
The problem is that I don't know how Perl will manage the memory.
Do you have experiences on such arrays after a big number of shift/push?
Will Perl reallocate former used memory (relased from the
Carter,
I'm with Johan Lindstrom - bind variables are the way to go. If you're
unfamiliar with them, they're a little strange at first. The following is
your script cold-coded to use bind variables and placeholders.
# Create the Insert
my $SQL = -- sql end --;
INSERT INTO scmrequests (Status,
lstein What do you want. The version with the newline or the version without? The
lstein current version (2.89) has no newline, and therefore should give you the
lstein popup menus closer
Yes, exactly.
The problem was I had old version with the newline in /Perl/bin
which was working I was
No problems with:
Norton Antivirus Corporate 7.60.926
ActivePerl 633
Windows 2000 SP2 (5.00.2195)
Tom Wyant
This communication is for use by the intended recipient and contains
information that may be privileged, confidential or copyrighted under
applicable law. If you are not the intended
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:
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...
Yeah, but there's nothing to stop people from doing that with closed source
either - using ResEdit on the Mac, I could
Perl2exe http://www.indigostar.comhttp://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...
That won't help you if people get your .exe. See:
This communication is for use by the intended recipient and contains
information that may be privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or
Title: RE: Source-Code-Protection
you could always write your apps as a CGI on a web server that only you have access to. You could also write client/server apps (using IO::Socket perhaps) -- of course your rogue code thieves would still have access to the client-side code... CGI would
Hi Friends,
This is more of a general question pertaining to Win32::AdminMisc
I have had problems with Win32::AdminMisc. You know, I was working
on a web project and needed to authenticate the Username and password on the
website to that of the Network. You guys helped me a lot
Title: RE: Source-Code-Protection
True. Or one could use Soap::Lite for selected portions of thecode,
and have the main perl script connect to the SOAP server to run the "meaty
bits".
Still,
this is a lot of trouble. I'm pretty much with Morbus on this one.
License your code properly and
All,
My apologies to the list for the previous empty note.
Starting about a day ago, everything I post to this list gets the following
reply from System Attendant [EMAIL PROTECTED]:
Trend SMEX Content Filter has detected sensitive content.
Place = [EMAIL PROTECTED]; ;
Sender = Thomas R
This question has been bugging me for a while now and I am hoping some of
you out there can tell me if my thinking is on-track or am I way off on this
one.
Say I've successfully written a daemon to monitor a directory for me using
Win32::Daemon and Win32::ChangeNotify. Win32::ChangeNotify only
At 14:39 2002-10-31 +0100, Thomas Drugeon wrote:
Will Perl reallocate former used memory (relased from the shift) to next
elements (from the push)?
IIRC perl is optimized for that scenario (I can't remember where I read it
though). It shouldn't be a problem.
/J
-- --- --
Thank you
Do you know any module implementig such queues in a file? like dmb tied
hashes do?
IIRC perl is optimized for that scenario (I can't remember where I read it
though). It shouldn't be a problem.
/J
___
Perl-Win32-Users mailing list
Sorry, I found it:
Tie::File
- Original Message -
From: Thomas Drugeon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, October 31, 2002 4:34 PM
Subject: Re: Implementing a queue, memory
Thank you
Do you know any module implementig such queues in a file? like dmb tied
Thomas R Wyant_III wrote:
snip
The things that XML::Simple will lose for you include:
snip
* The order of duplicate tags (e.g. multiple Member tags).
Does this mean that contents of the value array in the code below could
be out of order? I ran it through 10 value/value tags and
Put down the keyboard and step away from the computer and I'm sure
you'll be safe :-)
You have nothing to worry about as a consequence of the module in and of
itself. There is no particular reason that AdminMisc would blow
anything up any more than any other arbitrary application or
Chuck,
Thanks for all the help. I found the problem. This one is rather
embarrassing, but interesting so I thought I'd let the group in on it.
I was racking my brain thinking what the hell could enforce
permissions out side the standard Win2K user stuff. Then I remembered.
A while back I
Kevin,
gotcha..
Hope I didnot sound like Blowing the computer. I meant the hardware crash
or corrupting the windows functionality or scripts like winlogon.exe.
I just wanted to make sure I am not doing something that comes haunting(I
know today is halloween). all I am doing is checking if a
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, October 17, 2002 12:14 AM
Subject: Inline::C Win32 w/ adk
I would like to use the Inline::C module to write C code within a Perl
script. Inline works fine for basic C code, but I'm having problems when
password
(B
(B_
(BHP $B$d%a!<%k%"%I%l%9$r<+J,$@$1$N%*%j%8%J%k$K(B MSN $B%I%a%$%s(B
(Bhttp://onamae.msn.co.jp/
(B
(B___
(BPerl-Win32-Users mailing list
([EMAIL PROTECTED]
(BTo
- Original Message -
From: Patra, Anupam [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 01, 2002 9:21 AM
Subject: File::Tail
I am getting the following error while executing perl Makefile.pl
File::Tail will be installed without debugging information.
This
As always, Jenda, you absolutely ROCK! This is great!
About a year ago I started to add code to the extension so that you could
register callback routines for each event (pause, stop, continue,
interrogate, etc) so that you could let the extension perform the looping
and all your code would have
On Wed, 30 Oct 2002, Daniel Needles wrote:
Hello,
The following program:
use strict;
use warnings;
use Win32::OLE;
my $xlfile ='c:\tmp\Book1.xls';
my $xl_app = Win32::OLE-new(Excel.Application);
$xl_app-{'Visible'} = 0;
my $workbook = $xl_app-Workbooks-Open($xlfile);
On Wed, 30 Oct 2002, Cristian Carvajal wrote:
I have a question regarding to an aplication I am working on with an ulimited
while cicle
While (1) {
#code
}
This cicle keeps asking until one of the exit functions appears to finish the cicle.
My problem is that the cicle consumues
On Thu, 31 Oct 2002, Harald Wopenka wrote:
I think its a common problem with Perlprogs that u cant hide your
sourcecode. I heard about something like pl2exe but I dont think it works
and I even more dont think its free. A couple of month ago I saw a nice
protection:
#!/usr/bin/perl
use
On Thu, 31 Oct 2002, Tillman, James wrote:
Hi, i wonder how to remove the 4 first lines of a file in Perl?
How does this admittedly lazy-brained script work for you?:
---
open(IN,filetosnip.txt) or die $!;
open(OUT, tempfile.txt) or die $!;
$line = IN;$line = IN;$line = IN;$line = IN;
You can protect your code by creating an exe using perlapp. You can get an
evaluation license for free (valid for 3 weeks).
Matthew Greenberg
- Original Message -
From: Harald Wopenka [EMAIL PROTECTED]
To: Perl-Win32-Users [EMAIL PROTECTED]
Sent: Thursday, October 31, 2002 4:46 AM
On Thu, 31 Oct 2002, Issa Mbodji wrote:
Is there an Apache-Session module for window users? If so could
someone please send me the link so that I can download it.
We have an Apache-Session ppm package in our repository at
http://theoryx5.uwinnipeg.ca/ppmpackages/
--
best regards,
randy
On Thu, 31 Oct 2002, Thomas Drugeon wrote:
Thank you
Do you know any module implementig such queues in a file? like dmb tied
hashes do?
IIRC perl is optimized for that scenario (I can't remember where I read it
though). It shouldn't be a problem.
Although I haven't tried it,
On Thu, 31 Oct 2002, Mohanty, Debi (MED, TCS) wrote:
Hi Howard,
I tried to run the program with my 305MB file, but I got the
error saying Out Of memory.
The program I am using is
$/ = '@F' . chr(0x0D) . chr(0x0A) . chr(0x0D) . chr(0x0A);
open (INFILE, input.dat) || die failed!;
Just some thoughts from the administrator point of view here;
Any scripts that we write during company time for the company are
technically the property of the company we work for. The company decides
what they want you to do. If they're to be used in consulting, than the
writer must specify
On Thu, 24 Oct 2002, Fabricio Soares Martins - Site CBN - SGR wrote:
Hi everybody!
I did install the windows media 9 with the Cscript for encoding.
When i try to call this script from a cgi, the error message appears:
CScript Error: Loading your settings failed. (Access is denied. )
All,
I don't know if this was discussed before, but here it goes. I'd like to trigger an
uninstallation from the Add/Remove Programs applette from Windows' Control Panel, and
let the program's uninstallation routine run its course. Is there a module that I can
use? If there is, any pointing
Hi All,
I have a Perl app that executes a robocopy to move some files from a remote
server to the local server. The Perl app is executed from a web page and
has SYSTEM permissions (as near as I can tell). I'm using
Win32::AdminMisc::LogonAsUser and CreateProcessAsUser to elevate the
permissions
Use Win32::OLE and WMI.
-Original Message-
From: henry isham [mailto:henry;hish.net]
Sent: Thursday, October 31, 2002 12:28 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Scripting Add/Remove Uninstallation
All,
I don't know if this was discussed before, but here it goes. I'd
Krynicky,
This is just a guess, but are you relying on sendmail to send your emails?
if so, sendmail is a *unix* script. You need an SMTP server on your box.
Make sure you've got an SMTP server.
Ronan
-Original Message-
From: [EMAIL PROTECTED]
You wrote:
1. Please do not top-post.
2. Please read the message you reply to! I did not ask, I was
replying to M.Hall. HE was having problems. And he tried Net::SMTP
and Mail::Sender modules that are NOT dependent on sendmail
executable being available. You are right though that he needs an
At 12:44 30.10.2002 -0500, Stephens, Wes (N-Sybase) wrote:
Is there a string manipulation function to automatically trim leading and
trailing whitespaces?
No, but do it with regex:
$string =cat and dog ;
# trim beginning ws
$string =~ s/^\s+//;
# trim ending ws
$string =~ s/\s+$//;
Hi,
does anybody know why ActiveState still has not released their Win32
port of Perl 5.8.0? 5.8.0 is the current stable release and is out
since July 18. Maybe someone from ActiveState could say when something
could be expected.
Thanks,
--
rob.
___
On Wed, 30 Oct 2002, [iso-8859-1] Burak Gürsoy wrote:
$string =cat and dog ;
$string =~ s,^\s+(.+?)\s+$,$1,;
print $string;
-Original Message-
From: [EMAIL PROTECTED]
[mailto:perl-win32-users-admin;listserv.ActiveState.com]On Behalf Of
Stephens, Wes (N-Sybase)
Sent:
I've just uploaded a new module to my pages at
http://Jenda.Krynicky.cz
It should help you create Windows services.
If your service only needs to wake up once every N minutes all you
need is to tell Win32::Daemon::Simple how to name it, what account to
install it under, what parameters you
47 matches
Mail list logo