Sample Header Ad - 728x90

Ask Different (Apple)

Q&A for power users of Apple hardware and software

Latest Questions

1 votes
0 answers
101 views
How to set up web server with Perl CGI on Catalina
I've got an old MBP that's maxed out at MacOS 10.15.7 / Catalina, and I'm trying to use it as a web server capable of running Perl CGI scripts. Furthermore, I want to serve pages from **~/Sites**; I want to run the scripts with Perl 5.38, which I've installed under my home directory with perlbrew; I...
I've got an old MBP that's maxed out at MacOS 10.15.7 / Catalina, and I'm trying to use it as a web server capable of running Perl CGI scripts. Furthermore, I want to serve pages from **~/Sites**; I want to run the scripts with Perl 5.38, which I've installed under my home directory with perlbrew; I want to access the server from another machine on my LAN (i.e., not simply a localhost-only solution). One complication is that **homebrew** no longer officially supports Catalina, so I need to avoid trying a homebrew solution, and instead use Catalina-supplied things as much as possible (apart from Perl). I've managed to find enough instructions for configuring **/etc/apache2/*** so that pages are served from **~/Sites**, and I can access them from a different machine on the LAN. I've also been able to access a Perl script, **~/Sites/hello.pl**: #!/Users/chap/perl5/perlbrew/perls/perl-5.38.0/bin/perl print ""; print ""; print "Hello, World!"; print ""; print ""; print "

Hello, World!

"; my $version = $^V; print "Perl version: $version\n"; print ""; print ""; The output, when I browse **http://retsina.local/hello.pl** , is: Hello, World! Perl version: v5.18.4 So clearly the shebang line isn't being read, and I need to tell Apache to execute **perl** from a different location. Also, once I have that working, I expect there will be a lot more gotchas when I try to execute the real Perl script, which I've developed and tested in my own home directory while logged into my shell, with my own ENV, etc. Can someone provide some guidance here? I apologize for the lack of specificity -- this is mostly black magic to me. Glad to provide more details as requested.
Chap (1316 rep)
May 7, 2024, 05:27 PM
0 votes
1 answers
385 views
Run curl from a perl scripts
I'm trying to use curl from a perl script using a piped open format: ``` my @cmd = ('curl', '-u','username:password', '-g','-T', "$upfile","mydomain/directory"); die '@cmd must have more than one element' unless @cmd>1; open my $fh,'-|', @cmd or die $!; close $fh or die $! ? $! : $?; ``` but am gett...
I'm trying to use curl from a perl script using a piped open format:
my @cmd = ('curl', '-u','username:password', '-g','-T', "$upfile","mydomain/directory");
die '@cmd must have more than one element' unless @cmd>1;
open my $fh,'-|', @cmd or die $!;
close $fh or die $! ? $! : $?;
but am getting this error
curl: (23) Failed writing body
Running macOS 13.3. Anyone shed some light please?
Trudge (63 rep)
Apr 5, 2023, 10:19 PM • Last activity: Jan 1, 2024, 09:01 PM
4 votes
2 answers
3459 views
csshX not working in Ventura
I upgraded to Ventura this weekend, and now `csshX` won't run. I get the error messages ``` Unimplemented: POSIX::tmpnam(): use File::Temp instead at /System/Library/Perl/5.30/darwin-thread-multi-2level/POSIX.pm line 185. Unimplemented: POSIX::tmpnam() at /Users/barmar/bin/csshX line 1130. BEGIN fai...
I upgraded to Ventura this weekend, and now csshX won't run. I get the error messages
Unimplemented: POSIX::tmpnam(): use File::Temp instead at /System/Library/Perl/5.30/darwin-thread-multi-2level/POSIX.pm line 185.
Unimplemented: POSIX::tmpnam() at /Users/barmar/bin/csshX line 1130.
BEGIN failed--compilation aborted at /Users/barmar/bin/csshX line 1130.
I don't think the solutions at csshX not working on Mac OS Big Sur will work because perl5.18 doesn't exist any more. The only versions of perl are 5.30 and 5.34.
Barmar (1748 rep)
Oct 31, 2022, 03:10 PM • Last activity: Aug 2, 2023, 09:04 PM
0 votes
0 answers
98 views
Sudden unexplained change in perl behavior
I've been using zsh for at least a year, and I use perl in Terminal every day. Today, for the first time ever, launching Terminal got this: Last login: Thu Jul 13 08:50:35 on console Attempting to create directory /Users/WGroleau/perl5 ~/perl5 was actually created 24 May containing `man` and `lib` w...
I've been using zsh for at least a year, and I use perl in Terminal every day. Today, for the first time ever, launching Terminal got this: Last login: Thu Jul 13 08:50:35 on console Attempting to create directory /Users/WGroleau/perl5 ~/perl5 was actually created 24 May containing man and lib without that message, but it added the **empty** directory bin today.  ~/.cpan was also created 24 May. .zshrc contains eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)" but the date on that file is 16 June and no other dot-files have been edited since then.  The last macOS update was 21 June, macOS_13.4_22F66 to macOS_13.4.1_22F82. brew update also has not happened recently. **Why would perl suddenly decide to add the empty bin and why the message now when it added lib and man silently?** **Update:** Instead of that command doing two different things, it does **three**.  At the suggestion of "user1934428," I get the following: WGroleau@MBP ~ % perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5 PERL_MB_OPT="--install_base \"/Users/WGroleau/perl5\""; export PERL_MB_OPT; PERL_MM_OPT="INSTALL_BASE=/Users/WGroleau/perl5"; export PERL_MM_OPT; So this time, it either assigned two environment variables which I will have to track down the purpose of, or displays how they were assigned at some other time.
WGroleau (5370 rep)
Jul 13, 2023, 11:59 PM • Last activity: Jul 26, 2023, 08:21 PM
1 votes
2 answers
237 views
Escape control characters in bash script
I need a solution to escape control characters from a string. What I need is to turn this: `%f4^rH13#b$rHN` into this: `%f4\^rH13\#b\$rHN` I found a solution working with GNU `sed` on [stackoverflow][1], which won't work on vanilla macOS. I also found a solution to [escape ever character on macOS][2...
I need a solution to escape control characters from a string. What I need is to turn this: %f4^rH13#b$rHN into this: %f4\^rH13\#b\$rHN I found a solution working with GNU sed on stackoverflow , which won't work on vanilla macOS. I also found a solution to escape ever character on macOS . But I haven't found a solution to only escape control characters.
Nils (141 rep)
Apr 8, 2023, 01:48 PM • Last activity: Apr 8, 2023, 03:00 PM
2 votes
1 answers
962 views
csshX not working after updating macOS to Ventura 13.2.1
I installed `csshX` with `brew` and it was working well until I upgraded to Ventura 13.2.1 (22D68). I have the issue below: Unimplemented: POSIX::tmpnam(): use File::Temp instead at /System/Library/Perl/5.34/darwin-thread-multi-2level/POSIX.pm line 185. Unimplemented: POSIX::tmpnam() at /usr/local/b...
I installed csshX with brew and it was working well until I upgraded to Ventura 13.2.1 (22D68). I have the issue below: Unimplemented: POSIX::tmpnam(): use File::Temp instead at /System/Library/Perl/5.34/darwin-thread-multi-2level/POSIX.pm line 185. Unimplemented: POSIX::tmpnam() at /usr/local/bin/csshX line 1130. BEGIN failed--compilation aborted at /usr/local/bin/csshX line 1130. So I modified the csshX file to look like: use base qw(CsshX::Socket::Selectable); #use POSIX qw(tmpnam); use File::Temp qw/:POSIX/; use FindBin qw($Bin $Script); However I am getting this error: Can't locate Foundation.pm in @INC (you may need to install the Foundation module) (@INC contains: /Library/Perl/5.34/darwin-thread-multi-2level /Library/Perl/5.34 /Network/Library/Perl/5.34/darwin-thread-multi-2level /Network/Library/Perl/5.34 /Library/Perl/Updates/5.34.0 /System/Library/Perl/5.34/darwin-thread-multi-2level /System/Library/Perl/5.34 /System/Library/Perl/Extras/5.34) at (eval 8) line 1. BEGIN failed--compilation aborted at (eval 8) line 1. I see this in csshX: my $terminal; sub init { eval "use Foundation; use List::Util qw(min max)"; die $@ if $@; } How can I install this Foundation module?
Rajeev A R (21 rep)
Mar 14, 2023, 05:57 AM • Last activity: Mar 29, 2023, 07:31 PM
3 votes
1 answers
1790 views
Is there a Terminal command to verify macOS screensharing?
Is there a terminal command to determine if a screensharing session from a remote machine is not just initiated but also actively being viewed? Details: I have a background (Perl) process running on a remote machine that issues system commands like netstat -n | grep 5900 ps aux | grep ScreensharinAg...
Is there a terminal command to determine if a screensharing session from a remote machine is not just initiated but also actively being viewed? Details: I have a background (Perl) process running on a remote machine that issues system commands like netstat -n | grep 5900 ps aux | grep ScreensharinAgent to verify that a Screensharing session has been initiated. Both of these commands return expected data the moment Screensharing authentication begins. However, I'd also like the process to determine if the screen is successfully being viewed. da4 's comment here comes close but I can't/don't know how to modularize log stream --predicate 'eventMessage contains "Authentication"'. Here's a modified version of the Perl snippet I'm working on $owner = "owner" $user = trim(stat -f%Su /dev/console); while ($user eq $owner) { my $user = trim(stat -f%Su /dev/console); my %screensharing_processes = ( "netstat -n | grep 5900" => "\.5900.*?ESTABLISHED", "ps aux | grep ScreensharingAgent" => "$user.*?ScreensharingAgent.bundle", "terminal_command_to_verify_screensharing" => "some_string_verifying_condition", # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ); while (($command, $value) = each (%screensharing_processes)) { my $this_process = $command; if ($this_process =~ /$value/s) { print "$value is up\n"; } else { print "$value is down\n"; } } print "\n"; sleep 1; } sub trim { return $_ =~ s/^\s+|\s+$//rg; } Is there a terminal command which the remote machine's background process can issue to determine if the screensharing session is not just initiated but also actively being viewed? For obvious reasons, solutions like the accepted one in the question I mentioned won't work here.
Johnnie Wilcox (61 rep)
Dec 3, 2017, 06:09 AM • Last activity: Jan 4, 2023, 10:12 PM
0 votes
1 answers
68 views
accumulating terminal profiles
I have a "login item" which runs a short Perl script. It is a `*.terminal` file simply because I don't know how else to run a script as a login item (ie. there is no input or output). It works well, except for one thing: each time it runs, it creates a new copy of the Terminal profile. By now, I hav...
I have a "login item" which runs a short Perl script. It is a *.terminal file simply because I don't know how else to run a script as a login item (ie. there is no input or output). It works well, except for one thing: each time it runs, it creates a new copy of the Terminal profile. By now, I have about a hundred of them :-( This doesn't seem to happen with my other *.terminal files, but there are two key differences and I don't know which one is responsible for the behavior: 1. The others are not login items, I run them manually by double-clicking their icons. 2. The others are bash scripts, not Perl scripts. How can I prevent these new profiles? Again, I'm not married to Terminal - if there is a way to run a script at login time that doesn't involve Terminal, I prefer it. -- Ian
q.undertow (119 rep)
Jul 11, 2022, 03:48 PM • Last activity: Jul 13, 2022, 03:25 AM
1 votes
1 answers
335 views
What are prerequisites for using perlbrew?
I want to send a Perl app I wrote to a simple Mac "end-user". He's running Monterey, but he isn't a Developer, he doesn't have Xcode, and I'm going to have to hand-hold him through using the Terminal for this. After looking unsuccessfully for an easy way to bundle up my app and locally install the C...
I want to send a Perl app I wrote to a simple Mac "end-user". He's running Monterey, but he isn't a Developer, he doesn't have Xcode, and I'm going to have to hand-hold him through using the Terminal for this. After looking unsuccessfully for an easy way to bundle up my app and locally install the CPAN modules (couldn;t get App:FatPacker to work), I decided I'd have to get him to bite the bullet and install Perlbrew and thence Perl and the CPAN modules. Although it's not mentioned at perlbrew.pl, a C compiler is required and is not present on an off-the-shelf MacOS. The perl build fails, and a dialog box pops up saying Command Line Tools are needed, and offers to install them. Being on a slow cellular link, he had to decline until he can get to a wifi hotspot. Before he runs into more showstoppers, I need a clear answer to this: 1. Is there a command to perform this CLT installation? 2. Is Xcode required? 3. Does he need to be registered as an Apple Developer? 4. Are there any other prerequisites for installing Perlbrew that I haven't thought of? The first thing I do after installing MacOS is to install Xcode, so I don't have a system like his to experiment on.
Chap (1316 rep)
May 3, 2022, 03:02 PM • Last activity: May 4, 2022, 12:33 PM
0 votes
1 answers
127 views
"cpan install" trying to use /sw/bin/tar (instead of /usr/bin/tar)
I'm having no luck getting CPAN modules to install on my M1 Mac running Big Sur. They all seem to be trying to use /sw/bin/tar to untar the archives, but there is nothing there; tar is in /usr/bin/tar. Mac OS does *not* want me to create anything like /sw, so I can't create a link to it there or any...
I'm having no luck getting CPAN modules to install on my M1 Mac running Big Sur. They all seem to be trying to use /sw/bin/tar to untar the archives, but there is nothing there; tar is in /usr/bin/tar. Mac OS does *not* want me to create anything like /sw, so I can't create a link to it there or anything. The two modules I'm trying right now are GD and Imager, no luck on either. Who knows what additional problems I'll run into after this is solved, but right now I can't get past this point.
neilw (103 rep)
Jan 20, 2022, 06:49 PM • Last activity: Jan 20, 2022, 07:02 PM
3 votes
0 answers
351 views
Can't set any perl version as default in Macports
I installed perl_select, which I don't think, I've had to do for any other application. Despite that I cannot set any version of Perl as default as I easily can for python. ``` % port echo installed | grep ^perl perl5 @5.28.3_0+perl5_28 perl5.28 @5.28.3_2 perl5.30 @5.30.3_1 perl5.32 @5.32.1_1 perl5....
I installed perl_select, which I don't think, I've had to do for any other application. Despite that I cannot set any version of Perl as default as I easily can for python.
% port echo installed | grep ^perl
perl5                          @5.28.3_0+perl5_28
perl5.28                       @5.28.3_2
perl5.30                       @5.30.3_1
perl5.32                       @5.32.1_1
perl5.34                       @5.34.0_0
perl_select                    @0.3_0

% port select --list perl
Available versions for perl:
        none (active)
Philippe (889 rep)
Aug 2, 2021, 03:55 PM
0 votes
0 answers
1342 views
How do I need to configure the macOS logging system to log LOG_INFO messages from Perl?
In the dovecot port for macOS in MacPorts, there is a pushnotify capability (requires you to be able to create the right certificates). This is perl code that contains the following snippet: # Open the socket to Dovecot unlink $sockpath; umask (0111); my $socket = IO::Socket::UNIX->new( Type => SOCK...
In the dovecot port for macOS in MacPorts, there is a pushnotify capability (requires you to be able to create the right certificates). This is perl code that contains the following snippet: # Open the socket to Dovecot unlink $sockpath; umask (0111); my $socket = IO::Socket::UNIX->new( Type => SOCK_DGRAM, Local => $sockpath, Listen => SOMAXCONN, ) or die("Can't create server socket: $!\n"); drop_privileges($user); openlog ('apns', 'ndelay', 'mail'); # When we last checked the feedback service (right now, never). my $last_feedback = 0; # When we last reconnected to APNS my $last_connect = 0; # We'll defer connecting to APNS until our first notification, but define $apns here my $apns; syslog (LOG_INFO, 'Dovecot APNS service running'); Supposedly, this code wants to log using the old syslog interface. Now ASL supersedes syslog, but it is supposed to be able to catch the syslog stuff as well, when correctly configured. Or so I think. But I am unable to find that logging. During boot, I see warnings from ASL: Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.cdscheduler" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.install" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.family.asl" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.callhistory.asl.conf" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.contacts.ContactsUICore" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.authd" sharing output destination "/var/log/asl" with ASL Module "com.apple.asl". Output parameters from ASL Module "com.apple.asl" override any specified in ASL Module "com.apple.authd". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.authd" sharing output destination "/var/log/system.log" with ASL Module "com.apple.asl". Output parameters from ASL Module "com.apple.asl" override any specified in ASL Module "com.apple.authd". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.authd" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.eventmonitor" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mail" sharing output destination "/var/log/mail.log" with ASL Module "com.apple.asl". Output parameters from ASL Module "com.apple.asl" override any specified in ASL Module "com.apple.mail". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mail" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.coreaudio" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.performance" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.iokit.power" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "org.macports.daemon" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.contacts.ContactsAutocomplete" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mkb" sharing output destination "/private/var/log/keybagd.log" with ASL Module "com.apple.mkb.internal". Output parameters from ASL Module "com.apple.mkb.internal" override any specified in ASL Module "com.apple.mkb". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.mkb" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.AddressBookLegacy" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.MessageTracer" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.networking.boringssl" sharing output destination "/Library/Logs/CrashReporter" with ASL Module "com.apple.networking.networkextension". Output parameters from ASL Module "com.apple.networking.networkextension" override any specified in ASL Module "com.apple.networking.boringssl". Nov 23 11:20:54 localhost syslogd: Configuration Notice: ASL Module "com.apple.clouddocs" claims selected messages. Those messages may not appear in standard system log files or in the ASL database. which seem to imply that configuration may be an issue here. The perl program tries to send to syslog, syslog will catch it, but because syslog on macOS is ASL it somehow disappears in a black hole, even if there are output files mentioned, they tend to be empty or only have a few unrelated messages. I'd like to get to the bottom of his. Having no logging is killing me.
gctwnl (762 rep)
Nov 23, 2020, 11:15 AM • Last activity: Nov 23, 2020, 12:29 PM
0 votes
1 answers
320 views
Running perl shell script from AppleScript on Mojave
I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz). It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year) . set Clea...
I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz). It used to work exactly as I have it below, but no longer does (possibly since updating to Mojave last year). set CleanFiles to " s/one/two/g; " set myFolder to choose folder with prompt "Choose a folder with files to be cleaned up:" set theFolder to POSIX path of myFolder do shell script "find " & theFolder & " \\( -name \\*.txt -o -name \\*.xyz \\) -print0 | xargs -0 perl -i -pe '" & CleanFiles & "'" There is no error message, it seems to run but doesn't do anything. What could be wrong?
jan (842 rep)
Feb 4, 2020, 06:09 PM • Last activity: Feb 4, 2020, 07:11 PM
17 votes
2 answers
26498 views
How to install CPAN modules from the command line on OS X?
Simple question: How to install CPAN modules on OS-X like normal Linux/Unix way? I just want to type in `cpan` something like `install Perl6::Say` for example.
Simple question: How to install CPAN modules on OS-X like normal Linux/Unix way? I just want to type in cpan something like install Perl6::Say for example.
gaussblurinc (459 rep)
Dec 18, 2012, 04:14 PM • Last activity: May 21, 2019, 05:35 PM
0 votes
1 answers
756 views
How do I restore default perl in macOS Mojave?
Is there a way to restore default perl5 and cpan modules in Mojave without rebuilding the OS?
Is there a way to restore default perl5 and cpan modules in Mojave without rebuilding the OS?
user331414
May 5, 2019, 01:07 AM • Last activity: May 5, 2019, 09:20 AM
0 votes
1 answers
338 views
Proper shebang line for running perl script with an AppleScript on a perlbrew install?
I have the following simple AppleScript which calls a perl script I wrote to clean the desktop: do shell script "/Users/stevied/bin/clean_desktop.pl" The script works fine when run from the command line, but when executing the script from my AppleScript, the modules I `use` aren't found and I get th...
I have the following simple AppleScript which calls a perl script I wrote to clean the desktop: do shell script "/Users/stevied/bin/clean_desktop.pl" The script works fine when run from the command line, but when executing the script from my AppleScript, the modules I use aren't found and I get this error: > Can't locate Modern/Perl.pm in @INC (you may need to install the > Modern::Perl module) (@INC contains: > /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 > /Network/Library/Perl/5.18/darwin-thread-multi-2level > /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 > /System/Library/Perl/5.18/darwin-thread-multi-2level > /System/Library/Perl/5.18 > /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level > /System/Library/Perl/Extras/5.18 .) at > /Users/stevied/bin/clean_desktop.pl line 3. BEGIN failed--compilation > aborted at /Users/stevied/bin/clean_desktop.pl line 3. I have perlbrew installed. The current shebang line for the perl script is: #! /usr/bin/env perl
StevieD (1774 rep)
May 27, 2017, 05:12 PM • Last activity: Jan 16, 2019, 09:01 PM
4 votes
2 answers
13094 views
Perl RegEx in Mac terminal: grep -p "^([^\t]*\t){2}mypattern\t" textfile.txt doesn't work
I am a beginner of using programming commands. Why {2} is not functional after ([^\t]*\t) in macOS terminal? Is there any website providing Perl RegEx which works in mac? Thanks!
I am a beginner of using programming commands. Why {2} is not functional after ([^\t]*\t) in macOS terminal? Is there any website providing Perl RegEx which works in mac? Thanks!
Kylie M. (41 rep)
Aug 30, 2017, 05:23 AM • Last activity: Sep 30, 2018, 10:50 AM
2 votes
3 answers
2670 views
Crypt-SSLeay on a macbook
I'm trying to install Crypt-SSLeay on a macbook and it failed. I manually downloaded Crypt-SSLeay from cpan and issued: perl Makefile.pl The error is openssl-version.c:2:10: fatal error: 'openssl/opensslv.h' file not found #include ^ 1 error generated. Failed to build and link a simple executable us...
I'm trying to install Crypt-SSLeay on a macbook and it failed. I manually downloaded Crypt-SSLeay from cpan and issued: perl Makefile.pl The error is openssl-version.c:2:10: fatal error: 'openssl/opensslv.h' file not found #include ^ 1 error generated. Failed to build and link a simple executable using OpenSSL The file exists and it's located at: /usr/local/opt/openssl/include/openssl How do I go about fixing this, thanks.
BioRod
Jun 3, 2016, 07:59 PM • Last activity: Sep 22, 2018, 05:31 PM
0 votes
1 answers
766 views
Is El Capitan preventing me from getting the Perl module DBD::Oracle working?
Let me start by saying I'm not traditionally a Mac user. I'm still trying to transition from Gentoo, where compiling everything from source was the default state, and the system wasn't actively trying to prevent me from doing "dangerous" things. I have a new machine running 10.11. I've gotten `sqlpl...
Let me start by saying I'm not traditionally a Mac user. I'm still trying to transition from Gentoo, where compiling everything from source was the default state, and the system wasn't actively trying to prevent me from doing "dangerous" things. I have a new machine running 10.11. I've gotten sqlplus 11.2.0.4 running, and am able to connect to a remote Oracle server with it. I now want to use DBD::Oracle to connect in a Perl script. I was able to get DBD::Oracle to compile/install by manually passing a version to Makefile.pl rather than using CPAN (or, more specifically, cpanm): perl Makefile.pl -V 11.2 make make install However, when I run the script using the default Perl (5.18.2 located at /usr/bin/perl), I get an error: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) and or NLS settings, permissions, etc. In case the issue lies with the system perl, I installed perlbrew and then installed 5.22.0 into ~/perl5. Using the perlbrew Perl, I get a different error: dyld: lazy symbol binding failed: Symbol not found: _OCIAttrSet Referenced from: /Users/jrittenh/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/darwin-2level/auto/DBD/Oracle/Oracle.bundle Expected in: dynamic lookup dyld: Symbol not found: _OCIAttrSet Referenced from: /Users/jrittenh/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/darwin-2level/auto/DBD/Oracle/Oracle.bundle Expected in: dynamic lookup Trace/BPT trap: 5 I've tried: * both 32-bit and 64-bit Oracle libraries * symlinking libraries from the specific version (libclntsh.dylib.11.1 => libclntsh.dylib) * fixing hard-coded paths to /ade * creating a 'mesg' folder and made it writeable in $ORACLE_HOME * setting ORACLE_HOME, LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, and PATH to include /usr/local/oracle_client from /etc/profile, /etc/bashrc/, ~/.bashrc, and ~/.bash_profile Is there something else I can try? What am I missing?
ND Geek (153 rep)
Nov 18, 2015, 07:18 PM • Last activity: Aug 23, 2018, 02:00 AM
2 votes
1 answers
544 views
Perl library locations, and System Integrity Protection
My system `perl` seems to have a bunch of cruft left over from previous installations: % which perl /usr/bin/perl % perl -V | perl -ne 'print if /INC/...//' @INC: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/P...
My system perl seems to have a bunch of cruft left over from previous installations: % which perl /usr/bin/perl % perl -V | perl -ne 'print if /INC/...//' @INC: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 . Among the stuff in /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level is an old version of Moose.pm that doesn't work, so I want to get rid of it: % perl -MMoose -e1 Invalid version format (version required) at /Library/Perl/5.18/Module/Runtime.pm line 396. BEGIN failed--compilation aborted. % perldoc -l Moose /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/Moose.pm However, I can't: % sudo rm /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/Moose.pm Password: override rw-r--r-- root/wheel restricted,compressed for /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/Moose.pm? y rm: /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/Moose.pm: Operation not permitted I'm *guessing* that in my various OS updates over the years, Apple has moved some of my user-installed modules to this /System/Library/Perl/Extras directory, but then protected it with System Integrity Protection, so now I can't get rid of it (easily). Does that sound likely? If so - how the heck did this stuff get there? According to https://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really , any extra junk in /System that Apple didn't want there should have been moved to /Library/SystemMigration/History/Migration-(some UUID)/QuarantineRoot, right? I've never disabled SIP on this machine. So: what's the best way to deal with this? I can temporarily disable SIP and blow away /System/Library/Perl/Extras/5.18 or whatever - but I'd like some assurance that this isn't something Apple actually expects to be there. Is there a definitive list of what should be present in /System on my OS (which is High Sierra, 10.13.4 (17E199))?
Ken Williams (1734 rep)
Jun 25, 2018, 04:25 AM • Last activity: Jun 25, 2018, 05:14 AM
Showing page 1 of 20 total questions