Other comments on this question discuss elevating user permissions via
suid, sudo the setuid bit and so on.
There are good reasons to need to create files with owner/group that are
different from your own, they usually come up in system administration
situations. Most common situation where access
snip
> So I guess the question is -
>
> - is there a way in perl to authorize the callED perl script to have
> higher perms than the callING app's, so that it can write to the file I'm
> targeting?
>
> Or do I have to to this OUTSIDE of the perl script?
>
The short answer is that this is OS depen
> Is that your real program
Close, but copied from my (changing) notes, not from the actual code. See
below.
> but changing something to the same data amounts to it being *unchanged*,
> surely?
Nope. Not using Path::Tiny.
I found the info I need buried a further donw on its webpage. Appare
Hi
Is that your real program, because it's rather odd?
The built-in variable `$@` holds the message from the latest error to be
trapped by `eval`, so since you have no `eval` blocks it will probably be
`undef`. Did you mean to assign the command-line parameter, like this?
my ($newdata) = @
I have an application that calls a perl script, feeding it input over STDIN.
The perl script takes that input, processes it, and writes is as a change to an
output file.
I use Path::Tiny, and this works ok,
use Path::Tiny qw(path);
my $newdata = $@;
$newdata = (some pro
On Mar 2, 2:49 pm, teva...@gmail.com (Thomas Evangelidis) wrote:
> Hi again,
>
> I'm digging out this thread cause it seems that my problem has been only
> partially solved. Indeed "my @myout = `program file`;" can save the output
> of my program to an array for parsing but this doesn't happen when
Hi again,
I'm digging out this thread cause it seems that my problem has been only
partially solved. Indeed "my @myout = `program file`;" can save the output
of my program to an array for parsing but this doesn't happen when I use
programs with output that cannot be redirected to a file (i.e. erro
> -Original Message-
> From: Thomas Evangelidis [mailto:teva...@gmail.com]
> Sent: Thursday, February 19, 2009 08:27
> To: beginners@perl.org
> Subject: calling a program from a perl script and redirecting
> to output to a file
>
> Dear Perl programmers,
>
ilto:teva...@gmail.com]
> > > Sent: Thursday, February 19, 2009 08:27
> > > To: beginners@perl.org
> > > Subject: calling a program from a perl script and redirecting
> > > to output to a file
> > >
> > > Dear Perl programmers,
> > >
>
mas
2009/2/19 Wagner, David --- Senior Programmer Analyst --- CFS <
david.wag...@fedex.com>
-Original Message-
From: Thomas Evangelidis [mailto:teva...@gmail.com]
Sent: Thursday, February 19, 2009 08:27
To: beginners@perl.org
Subject: calling a program from a perl script and redirect
: Thursday, February 19, 2009 08:27
> > To: beginners@perl.org
> > Subject: calling a program from a perl script and redirecting
> > to output to a file
> >
> > Dear Perl programmers,
> >
> > I want to run a program from a perl script and redirect th
Dear Perl programmers,
I want to run a program from a perl script and redirect the its output to a
file. The programs is called apbs and takes 1 argument, so in unix shell I
'm simply typing the following:
$apbs input.in >$ output.txt # '>' doesn't work here
When u
On Jun 18, 7:12 pm, [EMAIL PROTECTED] (Dakin999) wrote:
> Hi, I am trying to write the script myself and now stuck at some
> thiong that I am pretty sure have been done by others. Any help will
> be significant.
>
> Ok, I have created an array and now I want to read from this array the
> elements a
On Wed, Jun 18, 2008 at 8:12 PM, dakin999 <[EMAIL PROTECTED]> wrote:
> Hi, I am trying to write the script myself and now stuck at some
> thiong that I am pretty sure have been done by others. Any help will
> be significant.
>
> Ok, I have created an array and now I want to read from this array the
Hi, I am trying to write the script myself and now stuck at some
thiong that I am pretty sure have been done by others. Any help will
be significant.
Ok, I have created an array and now I want to read from this array the
elements and put them in a LDIF format. Something like this:
dn: uid=xxx,cn=
On 12/12/2007, Chas. Owens <[EMAIL PROTECTED]> wrote:
>
> On Dec 12, 2007 7:08 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
>
> > Your last comment line ("it will close here") I would put inside the
> > block, or I would say "is closed with the block".
> > (I am all for lexical comments.)
> snip
>
> I ca
On Dec 12, 2007 7:08 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> "Chas. Owens" schreef:
snip
> > } #unless a reference was made to $fh it will close here
snip
> Your last comment line ("it will close here") I would put inside the
> block, or I would say "is closed with the block".
> (I am all for lexi
"Chas. Owens" schreef:
> Dr.Ruud:
>> Chas. Owens:
>>> (you should close file handles once you
>>> stop using them because they are a limited resource).
>>
>> I often start a new block at opening a file.
>
> If you are using the new scalar based file handles this is a good
> practice since they aut
On Dec 12, 2007 4:46 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> "Chas. Owens" schreef:
>
> > (you should close file handles once you
> > stop using them because they are a limited resource).
>
> I often start a new block at opening a file.
snip
If you are using the new scalar based file handles this
"Chas. Owens" schreef:
> (you should close file handles once you
> stop using them because they are a limited resource).
I often start a new block at opening a file.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On Dec 11, 2007 2:10 AM, patmarbidon <[EMAIL PROTECTED]> wrote:
> Patrick Marion has written:
> I think that your 'close (OUTPUT)' is inside the sub 'pits'
>
> you might put it before 'sub pits {' to get it at the logiccal end of
> your program.
snip
Or remove the close completely. Perl closes al
On Monday 10 December 2007 21:50, John Jack wrote:
>
> Hi Group
Hello,
> I'm new to perl and haven't used it before. I'm still practising and
> trying my best to know it. Anyway, I wanted to print the list of
> files in a directory with their full pathnames. This script below
> worked fine but I
Patrick Marion has written:
I think that your 'close (OUTPUT)' is inside the sub 'pits'
you might put it before 'sub pits {' to get it at the logiccal end of
your program.
John Jack has written :
Hi Group
I'm new to perl and haven't used it before. I'm still practising and trying
my best to
Hi Group
I'm new to perl and haven't used it before. I'm still practising and trying
my best to know it. Anyway, I wanted to print the list of files in a
directory with their full pathnames. This script below worked fine but I
want to write it to a file. Can someone help me, please? I know it must
Ryan Frantz wrote:
> Perlers,
Hello,
> I'm stumped; I have a script that should output to a file but it
> doesn't. The file is created, but it's empty after the script
> completes. To be sure I was getting some sort of output, I had the
> script write to the termi
> -Original Message-
> From: Ryan Frantz
> Sent: Monday, August 22, 2005 11:32 AM
> To: Beginners Perl
> Subject: I/O: Can't Output to a File
>
> Perlers,
>
> I'm stumped; I have a script that should output to a file but it
> doesn't.
Perlers,
I'm stumped; I have a script that should output to a file but it
doesn't. The file is created, but it's empty after the script
completes. To be sure I was getting some sort of output, I had the
script write to the terminal and all was well. The odd thing, however,
Thanks ALL for the quick help! i realised my mistake, "open" shd be
outside the loop..
:) :) (scripts that work, very pleasing!)
nandita
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
James Edward Gray II wrote:
>> open (OUT, '>outputfile.txt') or die "couldn't";
>> print OUT "$key\n\n", $alignments{$key},
>> "\nXXX\n"
the reason is in these 2 lines(especially the open() thingy). whenever you
ask Perl to open something for writing, Perl turncate t
You're real close to what you need here. You're just reopening (and
clearing) that file every time through the for loop. Move that open
statement to above the loop and everything will start working fine.
Good luck.
James
On Monday, September 9, 2002, at 11:49 AM, Nandita Mullapudi wrote:
09, 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: printing output to a file
hello list
i am trying to print the output of a parsing script to a file- the way it
is right now, the print commands are within a foreach loop, and it prints
to the screen. in order to get the entire output into a file, i
Mullapudi [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 09:49
To: [EMAIL PROTECTED]
Subject: printing output to a file
hello list
i am trying to print the output of a parsing script to a file- the way it
is right now, the print commands are within a foreach loop, and it prints
to the s
hello list
i am trying to print the output of a parsing script to a file- the way it
is right now, the print commands are within a foreach loop, and it prints
to the screen. in order to get the entire output into a file, i'm using a
simple set of commands like so:
foreach my $key (keys %a
/c0t0d0s0`
and write some code to print to a file
> -Original Message-
> From: Lance Martincich [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 25, 2001 2:09 AM
> To: [EMAIL PROTECTED]
> Subject: Sending command output to a file
>
>
> Hi
>
> I am
Hi
I am writing a script to automate a number of ufsdumps we do on our sun boxes. The
script I am using works fine, however I wish to send the output of the ufsdump
commands to a file and not display the output on the screen. The main reason is that
this file will store other info pertaining
lto:[EMAIL PROTECTED]]
Sent: Thursday, May 31, 2001 5:42 PM
To: [EMAIL PROTECTED]
Subject: Output to a file.
I've never written a line of perl before ... and I've only been lurking on
the list for three hours or so. But I've been presented some code which was
written for Unix and I
> When this is done running will it
> generate a file called sitelist.str.fo ?
Based on a quick glance at the script,
the stuff after the __END__ token is
not being used by the script.
So...
> if($QWFLAT eq '')
> {
> print "Enter QW flatfile file name -> ";
> chomp($QWFLAT = );
> }
Thi
I've never written a line of perl before ... and I've only been lurking on
the list for three hours or so. But I've been presented some code which was
written for Unix and I'm trying to run on NT using ActiveState Perl. It
converts a flat file from the USGS to a format we can get into our SQL
dat
38 matches
Mail list logo