Re: Can this OR be shortened?

2017-03-24 Thread Timo Paulssen
I seem to recall you asked about performance recently

the regex engine has a significant overhead. Your regex is equivalent to

$Terminal.contains('xterm' | 'linux')

though of course if you only test this once at the beginning of the
program, you can ignore that.


tip on using /etc/crontab

2017-03-24 Thread ToddAndMargo

Hi All,

Fedora Core 25 (Linux)

I just found out the hard way that if us use

 use Inline::Perl5;
 use Email::Simple:from;

your program will run from the command line, but when run
from /etc/crontab, your program will just disappear.

Mind you I actually did not use this code, I just
had forgotten to remove it.

It was a hair puller to find.

-T


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: Can this OR be shortened?

2017-03-24 Thread Darren Duncan
Just speculating, but try replacing the "||" with the "|" operator which should 
create an ANY Junction, if I'm not mistaken, which may then do what you want. -- 
Darren Duncan


On 2017-03-24 5:58 PM, ToddAndMargo wrote:

Hi All,,

if $Terminal ~~ /xterm/ || /linux/ {}
does not work

But this does
if $Terminal ~~ /xterm/ || $Terminal ~~ /linux/ {}

Can the if statement be shortened such that I do not
have to repeat $Terminal?


Many thanks,
-T



Re: Can this OR be shortened?

2017-03-24 Thread ToddAndMargo

On 03/24/2017 06:14 PM, Brandon Allbery wrote:


On Fri, Mar 24, 2017 at 8:58 PM, ToddAndMargo > wrote:

if $Terminal ~~ /xterm/ || /linux/ {}


if $Terminal ~~ /xterm || linux/ {}


Perfect!  Thank you!  I keep forgetting spaces are ignored in regex's


Re: Can this OR be shortened?

2017-03-24 Thread Brandon Allbery
On Fri, Mar 24, 2017 at 8:58 PM, ToddAndMargo  wrote:

> if $Terminal ~~ /xterm/ || /linux/ {}


if $Terminal ~~ /xterm || linux/ {}


-- 
brandon s allbery kf8nh   sine nomine associates
allber...@gmail.com  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net


Can this OR be shortened?

2017-03-24 Thread ToddAndMargo

Hi All,,

if $Terminal ~~ /xterm/ || /linux/ {}
does not work

But this does
if $Terminal ~~ /xterm/ || $Terminal ~~ /linux/ {}

Can the if statement be shortened such that I do not
have to repeat $Terminal?


Many thanks,
-T

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~