Groups
Sign in
Groups
perl.beginners
Conversations
About
Send feedback
Help
info
Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss
Learn more
Is this bit of scrip a reasonable way to test something
0 views
Skip to first unread message
hput via beginners
unread,
Jan 2, 2022, 10:45:04 PM
1/2/22
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to begi...@perl.org
I was just coding in in ksh93 for simple script but tangled up with
way matching and regex work in ksh93.
Finally trashed it turned to perl.
Just have familiarity with one way of test in shell script:
Put it in an if clause like (in shell):
if [ cd somedir ];then
print "ok permissions were good to enter somedir"
fi
------- ------- ---=--- ------- -------
Wanting to see if an encrypted dir is open
------- ------- ---=--- ------- -------
#!/usr/local/bin/perl
use strict;
use warnings;
my $loc = './s';
print "Testing with `chdir', if my perms are good to enter $loc\n";
if (chdir $loc) {
print "my perms worked to enter <$loc>\n";
}
Is this a reasonable way to do this or am I missing some thing that
will be quicker and more `perl' like?
Vlado Keselj
unread,
Jan 3, 2022, 1:00:05 AM
1/3/22
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hput, begi...@perl.org
It looks good to me.
> --
> To unsubscribe, e-mail:
beginners-...@perl.org
> For additional commands, e-mail:
beginne...@perl.org
>
http://learn.perl.org/
>
>
0 new messages