Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^3: Effective way in perl

by QM (Parson)
on Jul 17, 2009 at 14:48 UTC ( #781073=note: print w/replies, xml ) Need Help??

in reply to Re^2: Effective way in perl
in thread Effective way in perl

You have:
`$swlist -l depot @ $depot_locn | $grep $rel_string | $grep $i | $grep + AR >> blah`

which isn't pure perl code anyway, is it? (It's convenient to call grep 3 times, but might be more efficient to do with Perl's own grep.) Here, you're using perl just like you would use sh.

But to address your question, try:

`$swlist -l depot @ $depot_locn | $grep $rel_string | $grep $i | $grep + AR | tee file1 | tee file2 | tee file3 >> tee file4`
But if you need append, I don't think tee can do that.

Also take a look at Regexp Quote Like Operators and What's wrong with using backticks in a void context?

Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^4: Effective way in perl
by parv (Priest) on Jul 18, 2009 at 10:28 UTC
    Well, my tee(1)'s (FreeBSD 6 & CentOS 5) have -a, same as --append, option.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://781073]
[Corion]: marto: Heh ;) You're just further enabling their lazyness :-D
[marto]: they still don't know there was a problem, nobody told them! :P
[Corion]: marto: Ow! I would assume there is a cron job monitoring the free disk space and automatically opening a ticket at 90%, 95% and 100% usage...
[Corion]: Even we had automatic emails back when we maintained the machine ourselves...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-01-24 10:06 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (203 votes). Check out past polls.