Re: symlink to "pack"
Hi on 2019/9/10 3:18, John W. Krahn wrote: The operating system is written in C. The symlink(2) function is part of the operating system and is written in C. Therefore, when perl calls symlink(2) it has to send a valid C type string. Because your string starts with a NULL character it is a C string with zero characters. Good answer John. I have another question that, since perl is typeless language, how does perl know send the correct C type string to C's function? thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: symlink to "pack"
On 2019-09-08 12:20 p.m., Jorge Almeida wrote: On Sun, Sep 8, 2019 at 8:08 PM John W. Krahn wrote: On 2019-09-07 1:25 p.m., Jorge Almeida wrote: On Unix/Linux a character in a file name can be any character except a slash '/' character because that is used to separate path elements, or a null "\0" character because that is what the C language uses to signify the end of a string. Yes, but does a symlink target counts as a "file name"? Probably, but it's not very clear. (I didn't want to dereference the symlink, only readlink() it...) Jorge So your Perl string "\0\f" is read by C as a zero length string. The operating system is written in C. The symlink(2) function is part of the operating system and is written in C. Therefore, when perl calls symlink(2) it has to send a valid C type string. Because your string starts with a NULL character it is a C string with zero characters. John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Hi Folks : I'm trying to create a regular expression for finding a # wishing a dataset for only a number that is a multiple of 5
Thanks a lot Gautam S Desai On Sun, Sep 8, 2019 at 6:39 PM Mike wrote: > > It's probably best if you write a short script > that reads a __DATA__ section of data. > Then tell us what it does and what you expected > it to do. > > Off hand I don't see anything wrong with your regex, > but I don't know what you expect it to do. > > > Mike > > > On 9/8/2019 4:34 PM, Jim Gibson wrote: > > On Sep 8, 2019, at 1:30 PM, Gautam Desai > wrote: > >> Do you guys have any pointers ? > > $t =~ m{ > > ( # capture matched number in $1 > > \d* # match zero or more decimal digits > > [05] # followed by a '0' or '5' > > ) # end of capture > > (?: # followed by either: > > \D# a non-digit > > | # or > > $ # the end of the string > > ) > > }x > > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > >