I am on a Win32 system, and I use the fatalsToBrowser to prompt errors
with some scripts. However, the error mesg will also prompt where exactly
the file(script) is located. In case, I don't want the full path is
exposed. Can I modify sth , perhaps regex s///, to mask the root path ?
like
Nikola Janceski wrote:
WTF doesn't perl -c check for valid subroutines/function calls?
I can write a perlscript calling a function that doesn't exist but perl -c
will say syntax ok.
ie:
% perl -ce nothing_here('some junk')
-e syntax OK
% perl -e nothing_here('some junk')
Undefined
Kevin Old wrote:
I am writing a script for a client and they have requested an easy way
to configure their script.without having to enter the script code
itself.
Second, which sytax (in your opinion) should I use?
$CDMA::USER = myusername;
or
use constant USER = myusername;
Anthony E. wrote:
i have a bunch of text in a scalar $text
How would I keep the word count to a maximum, and just
dump the rest.. ie - I only want the paragraph to
contain 500 words, and trash the rest.
I know this isn't exaclty what you asked...
I'm taking a wild guess and thinking that
Gary Stainburn wrote:
I've got a perl script that takes text input from our switchboard and
feeds a call logging database.
Currently, I have a BASH script that calls kermit to control the serial
port
and pipe the output to my perl script (shown below). However, this causes
admin
Jon Howe wrote:
How do I capture the output from sendmail running under the -v switch back
to my programme.
The line I am using is -
open (MAIL, |/usr/lib/sendmail -oi -t -v) or die cant fork proc to
mail\n;
perldoc IPC::Open2
IPC::Run on cpan can do some clever stuff too
--
Best
Vishal Kapoor wrote:
thanx for the previous help
can we use system commands in a perl program , commands such as ls or grep
im sure we can , can someone point out how ???
You don't often see it mentioned, but there is a core module called
Shell.pm - try perldoc Shell to see what
Max Clark wrote:
I'm looking for a way to run an operation (like a while () loop for
example) until the user presses ctrl-c. Except instead of ending the
perl script I want to trap the ctrl-c and present the user a menu of
options.
This is very minimal:
,
| $SIG{INT} = sub { warn
Sunday, July 14, 2002, 5:18:14 PM, chris wrote:
I should have mentioned that the package does an import in main. This
will make it harder if not impossible to work around.
Using the sample provided
use DTK::WebAccess;
This will cause the import to occur leading to compile errors.
Drieux wrote:
I should have mentioned that the package does an import in main.
what exactly do you mean by 'import in main'?
this sounds way strange...
could you provide us with illustrative code here.
I presume what the OP meant was that the module has an import() subroutine
which
Sunday, June 30, 2002, 5:57:23 PM, drieux wrote:
I don't know if it's just me, but I didn't really understand
what you're actually trying to achieve...
Ok, so let's start with the simples stuff, I'm not God's
brightest child - so I tend to try stuff, and argue with
myself about whether or
Tuesday, June 18, 2002, 9:30:40 PM, Todd Wade wrote:
# this sub was written by Larry Rosler
# modified by me to get rid of the 'argument isnt numeric' warnings by -w
# i found it on deja
it's probably better to use timelocal() from the core
Time::Local module, if only for the reason that
Tuesday, June 18, 2002, 8:12:30 PM, A Taylor wrote:
I have a script that allows me to connect to my SQL Server7 database, and
run a SQL command:
use Win32::OLE;
$conn = new Win32::OLE('Adodb.Connection');
[snip]
$conn-Execute(EOF);
SELECT * FROM
Check perldoc -f chop
http://www.perldoc.com/perl5.6.1/pod/func/chop.html
Sunday, June 16, 2002, 9:29:00 AM, Chris Knipe wrote:
Hi,
How can I cut off the last char. of a string?
$string = 160700Z;
I want to remove the Z ?
This is to import METAR weather data if anyone's interested,
Friday, June 14, 2002, 8:36:01 PM, Torres, Jose wrote:
I have a script that opens a file and needs to grab certain values from it.
Can anyone recommend a good file tokenizing module? Thanks.
Is Parse::RecDescent what you want? or Parse::Lex perhaps...
--
Best Regards,
Daniel
Could be that someone would be interested in this thread
from fwp:
http:[EMAIL PROTECTED]/msg02488.html
Friday, June 14, 2002, 9:23:43 PM, Chas Owens wrote:
On Fri, 2002-06-14 at 15:50, todd r wade wrote:
Chas Owens wrote:
snip
Alternately, you could say:
$track ||= '';
This sounds fairly interesting...
http://developer.novell.com/ndk/perl5.htm
There's some docs at the bottom of that page about doing
stuff with Novell things using perl.
Can't say I've ever used it myself, and haven't touched a
netware box for years, but it looks like good stuff.
hth,
Daniel
Monday, March 18, 2002, 7:21:51 PM, John W. Krahn wrote:
perldoc perldiag
[snip]
Attempt to free unreferenced scalar
(W internal) Perl went to decrement the reference
count of a scalar to see if it would go to 0, and dis
covered that it had already gone to 0 earlier, and
Monday, March 18, 2002, 10:28:14 PM, Jonathan E. Paton wrote:
Even if it doesn't it solves the problem of having
duplicates. Then you can shuffle elements to get
your data set. There must be a decent shuffle
algorithm someplace, since I haven't thought of
one yet. splicing to pop
Sunday, March 17, 2002, 12:18:01 AM, Dave Chappell wrote:
Thanks. I got lots to learn about perl, thinking for the 2 hours I was
trying to solve my issue with chomp and split. I have began disecting your
reponse to learn from it. One question, the last print statement:
print $_ . \n;
what
Sunday, March 17, 2002, 10:41:01 AM, Mark Maunder wrote:
You have two dollar signs before the 'name' variable in
the loop. That probably works provided the value of the
variable is not a number, but it may be causing the
strangeness you're experiencing. Always 'use strict' in
your scripts.
Sunday, March 17, 2002, 12:43:07 AM, [EMAIL PROTECTED] wrote:
I'm writing a CGI program that requires that I discover the dimensions of an
image that a person uploads. Can perl or javascript do that?
The Image::Size module on CPAN does exactly that:
Sunday, March 17, 2002, 1:10:16 PM, Zysman, Roiy wrote:
I'm sorry if i wasn't clear
after tmp_ can come any character for example tmp_6676frf877 or
tmp_hbhbbd3y78783xcbh
how can i limit my regex to catch any character but not /
Thx Roiy
how about
m|/(tmp_[^/]+)|;
which says, match a /,
Sunday, March 17, 2002, 9:44:49 PM, swansong wrote:
I'm fairly certain I'm attacking this incorrectly, so any advice is
greatly appreciated...
Task:
I want to sort through my Solaris syslog (/var/adm/messages) looking for
any system
reboots which always start with the string SunOS and,
Hello John,
Monday, March 18, 2002, 5:15:18 AM, John wrote:
I do not understand the results of the following experiment, and would
appreciate input.
Using telnet on a Win PC, I executed this code:
perl -e print Hello world.\n\r' /dev/tty1
On my Linux system monitor
Saturday, March 16, 2002, 1:24:11 AM, Jenda Krynicky wrote:
Imagine you need to compute something and the formula is pretty
complex. Then for some input values it is not computeable,
because you divide by zero at one point or other. To find all the
forbidden input values and test them might
Saturday, March 16, 2002, 3:29:29 AM, Yuan Cheng wrote:
I am wondering what else 'use strict' does besides it
is stated in the perldoc that it stricts on use of
'vars', 'refs' and 'subs'. Thanks.
They basically stop you from doing things that are
dangerous, or stupid, or could break things
Saturday, March 16, 2002, 12:42:40 AM, Tiller, Jason wrote:
my %params;
$params{$_} = param($_) foreach param();
If I understand your code correctly, param() returns a list of all the
possible keys, right? If so, then the above code should work. You refer to
the parameters as
Saturday, March 16, 2002, 9:58:15 AM, Gary Hawkins wrote:
Web form element names automatically become script variable names and are
assigned their values...
use CGI 'param';
for $name (param()) {
$$name = param($name);
}
The double $$ is not a typo. Your question resulting in
then try \015\012
just out of interest, why can you not use NNTPClient.pm?
it's only one file...
Daniel Gardner [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Sunday, March 03, 2002, 1:11:39 AM, Hernan Freschi wrote:
I wrote a little scrip
Sunday, March 03, 2002, 1:11:39 AM, Hernan Freschi wrote:
I wrote a little script to get the newsgroup list from a newsserver. It
opens a socket, connects to it, writes LIST\n and does while (SOCKET)
'till /^\./.
The problem is that, it works only with some servers. On others, it just
keeps
Thursday, February 21, 2002, 12:31:45 AM, Scott Lutz wrote:
Where can one find a good reference to the perldocs?
I want to find out about push, so I tried :
perldoc list - No documentation found for push.
perldoc array - No documentation found for array.
perldoc list - No documentation found
Wednesday, February 13, 2002, 1:06:18 AM, Timothy Johnson wrote:
Looking at the command-line thing more closely, something like this should
work...
C:\ perl -e while(){s/good/bad/;print} test.txt
or
perl -pi -e 's/good/bad/' test.txt
take a look in perldoc perlrun, there's all sorts of
Sunday, January 27, 2002, 3:03:03 PM, Matt C. wrote:
There's a module called DBD::CSV, which will probably solve your problem. CPAN is
good at that :). You can tell it what the field separator is and then you'll be
able to manipulate it however you want with the DBI. I believe you'll need to
Sunday, January 27, 2002, 10:00:44 PM, Malunas wrote:
I have a log file in text format. I need to delete the first line so I could
put the rest in MySQL database. How do I delete only the first line of this
text file?
perldoc -q delete a line in a file
--
Best Regards,
Daniel
Sunday, January 20, 2002, 4:27:10 PM, Chris Ball wrote:
I really enjoyed this post. Does anyone else want to share some CPAN
modules or techniques they've found useful recently?
My plaything of recent times is Leon Brocard's GraphViz.pm module, which
allows you to graph from perl. There's
Wednesday, January 16, 2002, 6:45:40 PM, [EMAIL PROTECTED] wrote:
I'm using a nice little GDBM file for authentication. It just stores users
and passwords as SHA1 hashes. When I need to authenticate someone (fewer
than 15 lines in the dbm file) I just tie it and compare the SHA'd user
input
Hello Rajanikanth,
Thursday, January 17, 2002, 9:49:03 AM, Rajanikanth Dandamudi wrote:
Hello,
Can someone help me in getting the coverage of a perl
program. I had used the Coverage module of the perl
distribution by issuing a command:
perl -d:Coverage script_name [ args ]
Wednesday, January 16, 2002, 10:24:27 AM, Scott R. Godin wrote:
I've got an idea kicking around in my head ..
having a web-directory that can have image files added to it, taken
away, or prefaced with . to have them be ignored temporarily without
removing them.
[snip]
any pointers?
Tuesday, January 15, 2002, 6:16:49 AM, Chris Anderson wrote:
I need to find out which OS I am on -
It would be nice to know:
Ref Hiat
Mandrake
Slackware
W2K
W98
WME
WXP
Solaris
AIX, etc
but
Unix
Linux
W32
is fine also
How can I do this???
$^O should have the right stuff
Friday, January 11, 2002, 9:27:46 PM, Gary Luther wrote:
Here is what I know about the data I need to decrypt:
Algorithm - The block cipher DES is the standard cipher for all
encryption/decryption operations.
Padding - PKCS #5 padding is used.
Chaining - Cipher Block Chaining (CBC) is used
Friday, January 11, 2002, 3:12:19 PM, Scott wrote:
I am reading a file into a list and then formatting it to prepare it for a
mainframe. Currently I read the contents into a list as such:
my @fields = split(/\t/, $record)
and then I call them by $fields[0], etc.
Would it be more
Friday, January 11, 2002, 8:32:56 AM, Connie Chan wrote:
now, I am writing a script which to let user modify the password of
their email account automatically, but our email server will encrypy
the password in some ways. so it makes me unable to cmp or write.
such as, if I give A as a
Wednesday, January 02, 2002, 7:06:34 PM, Maciejewski, Thomas wrote:
how ?
through CGI?
can you post an example?
i can't say i've ever tried to build a perl with threading
enabled, but there's always lots of discussion on the mod_perl
mailing list about sharing data between processes. take
Thursday, December 20, 2001, 11:20:35 PM, Daniel Falkenberg wrote:
I was just wondering if any one here has any experience with download
Perl CPAN modules from a Perl script. I have looked at CPAN.pm but am a
little confused by this.
I have tried the following...
#!/usr/bin/perl -w
use
Thursday, December 20, 2001, 11:04:44 PM, [EMAIL PROTECTED] wrote:
Okay, let me just start by saying that I'm only looking for advice and
triage. (In other words, I'm not asking you to do the work for me. Please
don't send nasty emails along the lines of Use Google you moron. Done
that;
Wednesday, December 19, 2001, 4:38:03 PM, Ryan Guy wrote:
I want to get a consensus here. Do you think one liners are faster than
more extensive programs. Discuss.
they're both perl
they're both using the same interpreter
they're both doing the same job
if they're executing the same code,
Friday, December 14, 2001, 1:37:00 AM, Daniel Falkenberg wrote:
Could some one help me with the following code? Basically the code
works OK except for the fact that the user $new_user (s) home dir is not
created?
#!/usr/bin/perl -w
use Unix::PasswdFile;
my $new_user = test7;
my
Thursday, December 13, 2001, 8:28:53 PM, Mike Gargiullo wrote:
ok... I'm writing a perl program that will use scp to copy a file from
one machine to another securely.
The problem is that scp asks for the users password... how can I have
perl answer scp's request for a password...
by hand
Thursday, December 13, 2001, 2:48:16 PM, Warren, Barry wrote:
For example, I want to issue a command line prompt for the user to key in a
directory name.
I would like the current directory to be displayed on the command line and
be editable.
Key in directory name: /home/currentdir
how
Hello Daniel,
Wednesday, December 12, 2001, 11:31:13 PM, Daniel Falkenberg wrote:
# install my favorite programs if necessary:
for $mod (qw(Net::FTP MD5 Data::Dumper)){
my $obj = CPAN::Shell-expand('Module',$mod);
$obj-install;
}
I recieve the following error...
Can't locate object
Tuesday, December 11, 2001, 1:09:06 AM, Robert Thompson wrote:
I am using Data:Dumper in a script and am running into a problem with use
strict and eval. Basically the conundrum is that the data I will be loading from the
Data::Dumper file is going
to be based off input to the final
Tuesday, December 11, 2001, 6:38:47 AM, Daniel Falkenberg wrote:
Does any one know how I would go about deleing all hash keys with a star
in them from the following hash?
Would I go something like the following
#!/usr/bin/perl -w
%allusers = (
'users' = {
Tuesday, December 11, 2001, 2:12:05 PM, Ben Crane wrote:
I'm having to send some data out of MapBasic and into
a Perl program and then return it to MapBasic. I was
thinking a small perl DLL program would work. I know
how to send info to a DLL file, but HOW do you make a
perl DLL from
Friday, December 07, 2001, 5:18:38 AM, Aaron Shurts wrote:
AS Okay, I was the one that asked the crazy question about the weird join,
AS but I got that figured out. Now I have a problem.
AS while( ($login, $existingemail, $areacode, $prefix, $rest) =
$sth-fetchrow_array ())
AS {
AS
Friday, December 07, 2001, 7:38:11 PM, [EMAIL PROTECTED] wrote:
Is there a way to use die but not break the entire script?
system (dir $servervolume dirinfo) || die cant get dir info;
I want it that if does die to assign a value of zero to a variable? Is
that posssible?
how about:
Friday, December 07, 2001, 11:29:15 PM, Agustin Rivera wrote:
Is there a quick, simple command I can use to disable Modperl on all
variables in script, without having to qw' then all?
what do you mean when you say disable modperl?
--
Best regards, Daniel
Democracy: Two wolves and a sheep
Friday, December 07, 2001, 11:40:06 PM, Agustin Rivera wrote:
I am under the idea that modperl recycles as many variables as possible to
speed up script processing. I don't want it to recycle variables in some
scripts (in particular, ones I haven't written and have no desire to debug).
take
Why slow it down with the 'i'?
$searchstring=~/[a-zA-Z0-9]/;
Why slow it down with a regular expression? :-)
if ( $searchstring =~ tr/a-zA-Z0-9/ ) {
i was bored, and thought i'd try a little benchmark. note, this
is for the specific problem expressed here, not the general case.
i
Thursday, December 06, 2001, 8:23:27 PM, Agustin Rivera wrote:
AR Anyone use Procmail to pipe information to a Perl script for processing? If
AR so, any basic example of the procmail recipe and a Perl script would be
AR greatly appreciated.
something like
:0
*^TOwhoever
|
GS In the past, if I've let CPAN install a bundle for just about anything, it's
GS also gone and tried to upgrade perl first which to put it bluntly shafts my
GS box. I would like to avoid this while still making use of CPAN.
i believe that newer versions of the CPAN module don't have this
Tuesday, December 04, 2001, 9:32:37 PM, Ahmed Moustafa wrote:
AM I need documents describing the license of using Net:SFTP
at the bottom of the pod for Net::SFTP it says:
AUTHOR COPYRIGHTS
Benjamin Trott, [EMAIL PROTECTED]
Except where otherwise noted, Net::SFTP is Copyright 2001
Monday, December 03, 2001, 12:30:25 PM, Jules wrote:
J Our web server enables us to use 'SafePerl' for CGI scripts. I can find
J little information relating to this, and what subset of Perl commands are
J enabled (or correctly, which commands are disabled).
J Can anyone point me in the right
Monday, December 03, 2001, 8:14:48 PM, Wright, Thomas wrote:
WT When I do this in Perl thusly:
WT $oldfile = `system ls -1r $oldfile.\*.orig | head -1`;
you want to use system *or* backticks, not both.
$oldfile = `ls|head`;
should do the trick
here's something that will do it just in
Thursday, November 22, 2001, 2:19:16 PM, [EMAIL PROTECTED] wrote:
GFFC How would I check if a certain file exists in a certain directory?
GFFC I'm already using File::Find to process a bunch of mp3's, and before I
GFFC move/copy them to a different folder, I want to check if the file already
Wednesday, November 21, 2001, 6:35:46 PM, Tomasi, Chuck wrote:
TC I hate those. I usually end up creating a log file (or stderr in the case
TC of web apps) and just print them out to use them again. Nice debugging, but
TC needless in some cases.
TC If you figure a good way use the variable
Tuesday, November 20, 2001, 7:11:34 PM, Wagner-David wrote:
WD Here is a start:
WD Script starts on next line:
WD #!perl -w
WD printf %-20s - %-s\n, SortField, Url;
WD foreach my $MyData (sort {$a-[2] cmp $b-[2]} map{
[$_,/=([^]+).+\([^]+)\\/a/i ] } DATA ) {
WDprintf %-20s - %-s\n,
Tuesday, November 20, 2001, 8:41:03 PM, Ahmed Moustafa Ibrahim Ahmed wrote:
AMIA If I know the key and offset of the element, how can I delete that hash
AMIA element, please?
you can delete a hash element like:
delete $hash{ the_key };
but i'm not sure what you mean by the offset of the
- Original Message -
AMIA From: Daniel Gardner
AMIA To: Ahmed Moustafa Ibrahim Ahmed
AMIA Cc: [EMAIL PROTECTED]
AMIA Sent: Tuesday, November 20, 2001 12:50 PM
AMIA Subject: Re: How to delete hash element
AMIA Tuesday, November 20, 2001, 8:41:03 PM, Ahmed Moustafa Ibrahim
sre sorry for this question, but i'm not a perl programmer. =\
sre is there any similar function to php's include()?
sre i want to include an html file into the output the user will get when
sre opening the .pl
you could use a function something like:
sub echo_file {
my ($filename) = @_;
Monday, November 19, 2001, 4:41:21 PM, Bruce Ferrell wrote:
BF #begin example 2
BF use packagename();
BF sub1();
BF sub2();
BF #end example 2
BF No can someone explain to me what, if anything is incorrect about the
BF second example? What I'm looking for is how sub-routines are used from
BF a
PT Hi,
PT Iam a beginner in perl.I have one question,
PT Iam trying to write one prog,in which i have to search for one word in a
PT file,
PT If I found that word,print next 4 lines.
PT PLs help me,how to write code.
PT cheers,
PT prasa.
something like this should do the trick:
open FILE,
Manchester, UK
Friday, November 09, 2001, 4:07:57 PM, you wrote:
JE Leeds, UK
JE -Original Message-
JE From: Mike Gargiullo [mailto:[EMAIL PROTECTED]]
JE Sent: 09 November 2001 16:13
JE To: [EMAIL PROTECTED]
JE Subject: RE: Off-Topic (200%) - Where are you from?
JE Princeton Jct.,
LN I am attempting to create a hash slice from a hash. The hash is:
LN %hash =(test1 = test10,
LNtest2 = test12 ,
LN test3 = test13)
LN I want the slice to include only the keys test1 and test3. How can I
LN accomplish this?
FN Hey,
FN On an Oct 25 thread, someone asked how to remove trailing spaces.
FN The response was $Value =~ s/\s+$//.
FN Question.
FN 1. The string upon which this operation was made is on $_ correct?
no - $Value.
$Value = 'foo';
$Value =~ s/\s+$//;
$Value eq 'foo';
FN 2. If I've
S I have a systems hash that contains the type of system
S as keys and the name of the machines as values:
S %systems = (
Ssgi = [sgi1, sgi2],
Slinux = [linux1, linux2],
Sdec = [dec1, dec2]
S };
S Now, each type of system has default values like an
S email help address, shell
YR Looking for a little help for taking current time (from time) and finding
YR the time until 1 minute after midnight.
YR I have a daemon process (perl script) that needs to die ever new day,
YR the process should only run from 12:01 AM Today - l 12:01 AM Tomorrow
as ever there's more than
77 matches
Mail list logo